The Stack is managed using a simple LIFO strategy.The process of cleaning JVM memory is called “Garbage Collection” a.k.a “GC”.Not cleaning up will eventually halt the application as the fixed memory is used up and an out-of-memory or a stack-overflow exception occurs.Memory management is the process of cleaning up unused items in Stack and Heap.
Here is a quick overview of the JVM Memory management Understanding an tuning an application begins with understanding the technology running it. The Java Virtual Machine (JVM) runs standalone applications and many key enterprise applications like monolithic application servers, API Gateways and microservices.