mercredi 6 mai 2015

Java: Stopping application - what happens with objects in memory

I am wondering.. I have an application started on eclipse, simple Java application that is creating some objects in memmory that are leaking... For example I create a class with static hashmap storing strong references to objects. I am nearly running out of memory and I stop application clicking stop in Eclipse or kill -9 procId. I started that application with some jvm parameters like xms, xmx, maxpermsize. What happens with those created objects in JVM Heap / permgen? As long as the application was alive I had a method where I put strong references to static hashmap keys and it was not GC-ed (I checked it in VisualVM->VisualGC). Now I killed this application, what happens with these obects are they GC-ed immidiatelly or not GC-ed and the Heap allocated by my application is suddenly released without checking strong/weak references? How this mechanism is called?

Aucun commentaire:

Enregistrer un commentaire