The goal of this post is to get familiar with how memory works in java. We will see how it works in combination with the OS it runs on, how it’s structured and how it functions internally inside a JVM. By Nermin Karapandzic.
The article is split into:
- Heap
- Stack
- Code cache
- How does JVM manage heap
- Garbage collection in more detail
- Phases of garbage collection
Heap memory is used for dynamic allocation of java object and java classes in runtime. Newly created objects are always saved into heap space while the references to these objects are always in stack memory. Good read!
[Read More]