Skip to content

Uses IterateOverObjectsReachableFromObject to compute java object size

Notifications You must be signed in to change notification settings

marschall/object-size

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Java Object Graph Size

Uses IterateOverObjectsReachableFromObject to compute the size of an object and all the objects reachable from it.

During the execution of this function the state of the heap does not change: no objects are allocated, no objects are garbage collected, and the state of objects (including held values) does not change. As a result, threads executing Java programming language code, threads attempting to resume the execution of Java programming language code, and threads attempting to execute JNI functions are typically stalled.

If JFR is present we additionally generate a JFR event allowing you to assess the overhead.

Usage

The native agent has to be loaded using a JVM option.

-agentpath:/path/to/libobject-size-agent.so

Then it can be used from Java

ObjectSizeCalculator.getInstance().getObjectSize(myObject);

About

Uses IterateOverObjectsReachableFromObject to compute java object size

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published