org.eclipse.mat.snapshot
Class SnapshotInfo

java.lang.Object
  extended by org.eclipse.mat.snapshot.SnapshotInfo
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
XSnapshotInfo

public class SnapshotInfo
extends java.lang.Object
implements java.io.Serializable

Class describing an ISnapshot. Each snapshot has some core data, like the date when it was acquired/parsed, the number of objects inside... This data is available with the snapshot info which is usually serialized along with the snapshot.

See Also:
Serialized Form

Constructor Summary
SnapshotInfo(java.lang.String path, java.lang.String jvmInfo, int identifierSize, java.util.Date creationDate, int numberOfObjects, int numberOfGCRoots, int numberOfClasses, int numberOfClassLoaders, long usedHeapSize)
          Deprecated. 
SnapshotInfo(java.lang.String path, java.lang.String prefix, java.lang.String jvmInfo, int identifierSize, java.util.Date creationDate, int numberOfObjects, int numberOfGCRoots, int numberOfClasses, int numberOfClassLoaders, long usedHeapSize)
          Construct a snapshot info.
 
Method Summary
 java.util.Date getCreationDate()
          Get date when the snapshot was acquired/parsed.
 int getIdentifierSize()
          Get size of the internal identifiers in the heap dump, i.e.
 java.lang.String getJvmInfo()
          Get version of the JVM from which it was acquired.
 int getNumberOfClasses()
          Get number of Java Classes found in the snapshot.
 int getNumberOfClassLoaders()
          Get number of ClassLoaders found in the snapshot
 int getNumberOfGCRoots()
          Get number of GC roots found in the snapshot.
 int getNumberOfObjects()
          Get number of Java objects found in the snapshot.
 java.lang.String getPath()
          Get the absolute path of the heap dump file.
 java.lang.String getPrefix()
          Get the common prefix used to name all additional (e.g.
 java.io.Serializable getProperty(java.lang.String name)
          Get extra information about the snapshot
 long getUsedHeapSize()
          Get number of bytes used in the heap (the allocated memory may be higher)
 java.io.Serializable setProperty(java.lang.String name, java.io.Serializable value)
          Store extra information about the snapshot
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnapshotInfo

public SnapshotInfo(java.lang.String path,
                    java.lang.String prefix,
                    java.lang.String jvmInfo,
                    int identifierSize,
                    java.util.Date creationDate,
                    int numberOfObjects,
                    int numberOfGCRoots,
                    int numberOfClasses,
                    int numberOfClassLoaders,
                    long usedHeapSize)
Construct a snapshot info.

Parameters:
path - path from where the snapshot was acquired
jvmInfo - version of the JVM from which it was acquired
identifierSize - size of the internal identifiers in the heap dump, i.e. 32 or 64 bit
creationDate - date when the snapshot was acquired/parsed
numberOfObjects - number of Java objects found in the snapshot
numberOfGCRoots - number of GC roots found in the snapshot
numberOfClasses - number of Java Classes found in the snapshot
numberOfClassLoaders - number of ClassLoaders found in the snapshot
usedHeapSize - number of bytes used in the heap (the allocated memory may be higher)

SnapshotInfo

@Deprecated
public SnapshotInfo(java.lang.String path,
                               java.lang.String jvmInfo,
                               int identifierSize,
                               java.util.Date creationDate,
                               int numberOfObjects,
                               int numberOfGCRoots,
                               int numberOfClasses,
                               int numberOfClassLoaders,
                               long usedHeapSize)
Deprecated. 

Method Detail

getProperty

public java.io.Serializable getProperty(java.lang.String name)
Get extra information about the snapshot

Parameters:
name - keep_unreachable_objects - GCRootInfo.Type hprof.version org.eclipse.mat.snapshot.UnreachableObjectsHistogram $heapFormat
Returns:
the extra (serializable) information

setProperty

public java.io.Serializable setProperty(java.lang.String name,
                                        java.io.Serializable value)
Store extra information about the snapshot

Parameters:
name -
value - keep_unreachable_objects - mark as GCRootInfo.Type hprof.version org.eclipse.mat.snapshot.UnreachableObjectsHistogram $heapFormat
Returns:
the previous extra (serializable) information, or null

getPath

public java.lang.String getPath()
Get the absolute path of the heap dump file.

Returns:
absolute path of the heap dump file.

getPrefix

public java.lang.String getPrefix()
Get the common prefix used to name all additional (e.g. index) files. The prefix includes the directory path.

Returns:
common prefix used to name additional files

getJvmInfo

public java.lang.String getJvmInfo()
Get version of the JVM from which it was acquired.

Returns:
version of the JVM from which it was acquired

getIdentifierSize

public int getIdentifierSize()
Get size of the internal identifiers in the heap dump, i.e. 32 or 64 bit, in bytes.

Returns:
size of the internal identifiers in the heap dump, i.e. 32 or 64 bit

getCreationDate

public java.util.Date getCreationDate()
Get date when the snapshot was acquired/parsed.

Returns:
creation date, or null if the creation date is not known

getNumberOfObjects

public int getNumberOfObjects()
Get number of Java objects found in the snapshot.

Returns:
number of Java objects found in the snapshot

getNumberOfGCRoots

public int getNumberOfGCRoots()
Get number of GC roots found in the snapshot.

Returns:
number of GC roots found in the snapshot

getNumberOfClasses

public int getNumberOfClasses()
Get number of Java Classes found in the snapshot.

Returns:
number of Java Classes found in the snapshot

getNumberOfClassLoaders

public int getNumberOfClassLoaders()
Get number of ClassLoaders found in the snapshot

Returns:
number of ClassLoaders found in the snapshot

getUsedHeapSize

public long getUsedHeapSize()
Get number of bytes used in the heap (the allocated memory may be higher)

Returns:
number of bytes used in the heap (the allocated memory may be higher)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object