public class ObjectMemoryProfile
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.log4j.Logger |
LOGGER
Used for logging.
|
Modifier | Constructor and Description |
---|---|
protected |
ObjectMemoryProfile(ProfilingFilter globalFilter,
java.util.Map<java.lang.Class,ProfilingFilter> filterMap,
boolean buildChildRelations)
Sets up the profile
|
Modifier and Type | Method and Description |
---|---|
void |
dumpToXML(java.lang.String file)
Dumps the information to an XML file.
|
long |
getBytesUsed()
Returns the total number of bytes of the root object given
|
java.util.Map<java.lang.Class,com.screenscraper.profiling.ObjectMemoryProfile.ProfileClassDetail> |
getProfileClassDetails()
Returns a copy of the map of details for the classes discovered during the profiling process
|
java.util.List<com.screenscraper.profiling.ObjectMemoryProfile.ProfileClassDetail> |
getSortedProfileClassDetails()
Returns a sorted list of details for the classes discovered during profiling.
|
java.util.List<TrackedObject> |
getTrackedObjects(boolean sortByTotalBytes)
Returns a list of all objects discovered while building the profile
|
protected void |
profileObject(java.lang.Object object)
Method called to profile an object.
|
void |
setSortMethod(ProfileSort sortMethod)
Sets the sort method for class details
|
java.lang.String |
toString() |
protected ObjectMemoryProfile(@NotNull ProfilingFilter globalFilter, @Nullable java.util.Map<java.lang.Class,ProfilingFilter> filterMap, boolean buildChildRelations)
public long getBytesUsed()
@NotNull public java.util.Map<java.lang.Class,com.screenscraper.profiling.ObjectMemoryProfile.ProfileClassDetail> getProfileClassDetails()
@NotNull public java.util.List<com.screenscraper.profiling.ObjectMemoryProfile.ProfileClassDetail> getSortedProfileClassDetails()
@NotNull public java.util.List<TrackedObject> getTrackedObjects(boolean sortByTotalBytes)
sortByTotalBytes
- True to sort by total bytes used by the object, false to sort based on the shallow size of the objectprotected void profileObject(@NotNull java.lang.Object object)
object
- The object to profile@NotNull public java.lang.String toString()
toString
in class java.lang.Object
public void setSortMethod(ProfileSort sortMethod)
sortMethod
- Sets the type of sorting that should be used for details from the profile. These can be class name, bytes used, etc...public void dumpToXML(@NotNull java.lang.String file)
file
- The name of the file to dump the profiling details to