Microsoft SDK for Java

IJavaHeapMonitor : IUnknown

The IJavaHeapMonitor interface is used by a memory profiler to communicate with the Microsoft VM for registering the heap monitoring callback interfaces implemented by the profiler and to request heap monitoring information from the Microsoft VM.

The Microsoft VM implements the IJavaHeapMonitor interface. A profiler can determine if the Microsoft VM supports heap monitoring and locate this interface by calling QueryInterface on the IJavaEventMonitorIDInfo interface passed to the profiler upon startup. The profiler application should query for the IJavaHeapMonitor interface (IID_IJavaHeapMonitor).

The profiler or heap monitoring application that plans to use the interface should call the AddRef method on IJavaHeapMonitor.

A profiler or heap monitoring application can call methods on the IJavaHeapMonitor interface to request heap information about an executing Java process. The profiler must call GetHeapInfo on this object's interface to provide a callback through which the Microsoft VM communicates with the profiler regarding heap enumerations after garbage collection. The profiler must call NotifyOnObjectAllocations on this object's interface to provide a callback through which the Microsoft VM communicates with the profiler for notification on individual Java object allocations.

The heap monitoring interface uses the concept of containers for representing heap usage. Using containers, a memory profiler application can completely rebuild all the containment hierarchy for heap memory starting from root containers. Container types are defined for threads, static class references, objects awaiting finalization, internal VM objects, and various frames (native, native garbage collection, COM, interpreted method, and fast-interpreted method).

The methods implemented on this interface return S_OK on success, or E_FAIL on failure.

  // Methods
  GetContainerDescription
  GetHeapInfo
  GetObjectAge
  ModifyHeapMonitorCapabilities
  NotifyOnObjectAllocations

© 1999 Microsoft Corporation. All rights reserved. Terms of use.