How can I prevent memory leak after termination of application?
step 1.HashMap has data in it.
step 2.GC never think it as a garbage because HashMap has data.
step 3.Application is finished.
Memory still has HashMap data?
But right before the application is finished, I assigned HashMap = null.
Now, the application is terminated?
In this case, GC is also terminated, isn't it?
first of all, what I wrote above is true?
My goal is no memory leakage. When the application is over,
the HashMap data shouldn't be in memory.
How can I do that?
thanks -
another question, right before the application ends,
even though I assigned null to all parameters,
what is happening exactly?
can GC clear off all the parameters with value of "null"
from the memory right before the end of appliation?
I really want to know what GC does right before the end of
termination. such as windowclosing() of application.
It would be really appreciated if you let me know.
or point out the place that describes.
Thank you -
> an GC clear off all the parameters with value of
> "null" from the memory right before the end of appliation?
Why is this important to you?
When the application ends -- in other words, when the JVM shuts down -- every bit of memory that it consumed -- heap, stack code, whatever -- is returned to the OS. There isn't anything that Java can leak, because there isn't any JVM.