To use the heap monitoring interfaces, a memory profiler must first determine if the Microsoft VM supports heap monitoring. A profiler can determine if heap monitoring is supported by calling QueryInterface on the IJavaEventMonitorIDInfo interface for the IJavaHeapMonitor interface (IID_IJavaHeapMonitor). For specific interfaces and their methods, see the Heap Monitor Information Profiler Interface Reference.
The IID for the IJavaHeapMonitor interface and the other Java heap monitoring interfaces are defined in Jevmon.h, which is installed in the \Include directory of the Microsoft SDK for Java. Jevmon.h also contains definitions of the heap monitoring interfaces.
IJavaHeapMonitor is used by a memory profiler to communicate with the Microsoft VM. The profiler must call GetHeapInfo to provide a callback through which the Microsoft VM communicates with the profiler regarding heap enumeration after garbage collection.
The profiler must call NotifyOnObjectAllocations to provide a callback through which the Microsoft VM communicates with the profiler for notification on individual Java object allocations.
A memory profiler must register its heap monitoring callback interfaces with the Microsoft VM. To register with the Microsoft VM, a memory profiler must call methods of the IJavaHeapMonitor interface to install callback routines. A memory profiler can register a callback to receive notifications of individual object allocations and a separate callback that can be used to obtain a detailed heap dump after garbage collection.