java - Tracing garbage collection -


I have a problem with interaction with a scripting library and to verify my doubts, I know the examples of some sections Imagine GCD (either in Eclipse or JavivelMM or through command line JVM option). I do not have to discriminate between examples of classrooms, because I can limit this issue in an example.

Is this possible with stock VM?

I do not think you can do it from the outside, usually GC is running like this It takes action on retaining live instance, and the "archive" of the garbage is contained only: the determination of the memory areas is only made available for the allocation.

The closest you are being received is being informed when an object has reached the final position, which is still happening before it is actually collected. For this, you can add some code that will make PhantomReference s the object of your interest and register them with ReferenceQueue . You can monitor the queue for the final item. Note that in the description of these mechanisms there are many words of "at that time or some time later"; You can not rely on real-time accuracy.

Also keep in mind that the above mechanism will upset the observed system and will not work in the same way when there is no phantom reference to track.


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

class - Kivy: how to instantiate a dynamic classes in python -