I was using JVisualVM to look at an application, and I saw many objects of SomeDomainClass in the memory profiler and snapshot. A Java heap dump (.hprof file) produced shortly thereafter contained no instances of SomeDomainClass. Because the memory profiler "displays the total number of objects allocated", and the hprof file contains the objects active in the heap, does this suggest that the application is creating many short-lived instances of SomeDomainClass?
Actually, when you start generating the heap, visualVM
will call the GC
just before start collecting the objects to determine the live objects. then collecting them.
So if your Heap is not showing any instance of SomeDomainClass
class, then yes the SomeDomainClass
instants are short-live, in other world, these instances didn't have any reference while generating the heap.