The FROM clause defines the classes on which to operate. Specifiy the class by one of the following means:
by class name:SELECT * FROM java.lang.Stringby a regular expression matching the class name:
SELECT * FROM "java\.lang\..*"by the object address of the class:
SELECT * FROM 0xe14a100by the object id:
SELECT * FROM 3022by a sub select:
SELECT * FROM ( SELECT * FROM java.lang.Class c WHERE c implements com.sap.tools.memory.snapshot.model.IClass )
The statement returns all objects in the heap. The implements check is necessary, as the heap dump can contain java.lang.Class instances caused by proxy classes. The same effect has the following query, which calls a method directly on the ISnapshot object:
SELECT * FROM $snapshot.getClasses()
Use the INSTANCEOF keyword to include objects of sub-classes into the query:
SELECT * FROM INSTANCEOF java.lang.ref.Reference
The resulting table contains, amongst others, WeakReference and SoftReference objects because both classes extend from java.lang.ref.Reference . By the way, the same result has the following query
SELECT * FROM $snapshot.getClassesByName("java.lang.ref.Reference", true)
Use the OBJECTS keyword if you do not want to process the term as classes:
SELECT * FROM OBJECTS java.lang.String
The result is just one object, the java.lang.String class object.