-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path To GC Roots gives incomplete information #18
Comments
By Jonathan Lawrence on Feb 15, 2012 11:29 Created attachment 211050 Running the attached testcase (java -Xmx2m WeakHashLeak) with appropriate JVM options can produce a heap dump. :compression: WeakHashLeak.zip |
By Andrew Johnson on May 09, 2012 10:52 I don't know the paths code that well, but it might be deliberate. The algorithm seems to be to maintain a list of paths from the object by looking at inbound references, and if an inbound reference is found which has not been visited then add it to the list of paths, which is processed in FIFO order until a root is found. This means longer paths will be excluded in favour of shorter paths. so reversing paths We need a better explanation of what the paths queries do. The PHD problem is probably because PHD files do not have field names, so MAT doesn't know which references are weak refs. |
By Jonathan Lawrence on Jul 27, 2012 08:59 Here is a patch which changes the behaviour when field names are unavailable (eg for .phd files). It changes the presumption that a valid named strong reference must be present for there to be a strong path, to assume that if no named reference can be found at all, there might be a strong one. I think this is an improvement because it is less misleading to include paths to a GC root which might be excludible, than to exclude valid strong paths - which is what happens at the moment. However it's still not ideal because really we would want the "exclude weak references" and similar option(s) to be unavailable (greyed out?) if they cannot be correctly computed for a given dump - and also with a message or explanation as to why they are unavailable. Can anyone suggest how to do this? Index: SnapshotImpl.java
|
By Andrew Johnson on Aug 30, 2012 04:46 Please add the patch as an attachment - it makes it easier for the IP log, and Bugzilla will show the effect of the patch. There is similar code in ObjectMarker too. |
By Andrew Johnson on Aug 30, 2012 10:16 We should examine all uses of IObject: For PHD files not all outbound refs are listed (as there is not field data, just the refs). Is this API meant to list all references, including unnamed ones? That would be hard for PHD files which would require the creation of dummy fields. Instead we should check if getOutboundReferences is just used to get descriptions of outbounds from the index. |
By Andrew Johnson on Sep 05, 2012 09:57 Making those changes might cause a problem with the Weak References Statistics etc. queries. A total of 848 java.lang.ref.WeakReference objects have been found, which weakly reference 226 objects. We may need to check the logic for ReferenceQuery to see how it finds weak refs and strong refs. See defect 266231. |
| --- | --- |
| Bugzilla Link | 371642 |
| Status | NEW |
| Importance | P3 normal |
| Reported | Feb 15, 2012 11:20 EDT |
| Modified | Sep 05, 2012 09:57 EDT |
| Reporter | Jonathan Lawrence |
Description
Build Identifier: Eclipse Memory Analyzer Version 1.2.0
In some cases, the Path To GC Roots query does not return all active paths to an object.
Sometimes the missing paths can be the ones which are actually causing the object to be retained in the heap (eg sole strong reference, or sole path).
Reproducible: Always
Steps to Reproduce:
The text was updated successfully, but these errors were encountered: