March 2019
Intermediate to advanced
242 pages
6h 21m
English
JVM defines different memory management mechanisms with stack and heap memory. All GCs clean up the heap memory area by reclaiming the space occupied by unused or unreferenced objects. The GCs don't reclaim space from stack memory.
The stack memory area is used by a current thread for the execution of a method. When the current thread completes the execution of the current method, stack memory is released (without involving a GC collection). The primitives are stored on stack memory.
In a method, the local primitive variables and references to objects (not the actual objects) are stored on the stack. The actual objects are stored on the heap. The local primitive variables and reference variables ...
Read now
Unlock full access