Is the garbage collector in Java used for clearing unused objects from heap memory only, or does it actually lend a hand in cleaning the stack memory too?
The only things that lives on the stack are references and instances of primitive types. Both of those are ignored by the garbage collector.
There is no garbage that lives on the stack.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With