Bug 580107 - Improve System Properties query with discarded objects
Summary: Improve System Properties query with discarded objects
Status: VERIFIED FIXED
Alias: None
Product: MAT
Classification: Tools
Component: Core (show other bugs)
Version: 1.12   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.14.0   Edit
Assignee: Andrew Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-08 08:22 EDT by Andrew Johnson CLA
Modified: 2023-03-20 06:38 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Johnson CLA 2022-06-08 08:22:33 EDT
For large heaps, when objects have been discarded such as Strings, char[] or byte[] then the 'System Properties' query has a lot of 'null' entries and is not that useful.

See bug 473113 comment 16.

It might be possible to improve this query if unindexed objects are accessible by address.

Also, Copy > Class Name and Copy > Value could handle unindexed objects better.

Also, if there is code elsewhere such as

                int segmentId = snapshot.mapAddressToId(addr);
                IObject segment = snapshot.getObject(segmentId);

this could be handled as
                ObjectReference ref = new ObjectReference(snapshot, addr);
                IObject segment = ref.getObject();

The Javadoc for ISnapshot, ObjectReference should be updated to suggest that idiom. Note that access to unindexed objects via ObjectReference requires support from the parsers; HPROF and DTFJ do handle this.
Comment 1 Eclipse Genie CLA 2022-07-09 07:47:05 EDT
New Gerrit change created: https://git.eclipse.org/r/c/mat/org.eclipse.mat/+/194650
Comment 2 Andrew Johnson CLA 2022-07-09 09:46:10 EDT
Replace uses of 
    snapshot.getObject(snapshot.mapAddressToId(address))
with
    ObjectReference ref = new ObjectReference(snapshot, address);
    IObject object = ref.getObject();
    
 Also make sure that the HTML reports for unindex objects (so no object ID, but getOQL() returns the address)
 have links.
Comment 4 Andrew Johnson CLA 2022-07-10 06:10:05 EDT
Now fixed.