Microsoft SDK for Java

IJavaHeapMonitor::
NotifyOnObjectAllocations

The NotifyOnObjectAllocations method of the IJavaHeapMonitor interface is called by a memory profiler to register its callback interface for receiving notification when an individual object is created (allocated on the heap). The single parameter passed in is a pointer to the IObjectAllocationCallback interface implemented by the profiler. A memory profiler can only have one callback installed at a time. To unregister the callback, this method can be called with a NULL pointer.

The Microsoft VM communicates with the profiler, notifying it when an object is allocated. The VM does so by calling the OnObjectAllocated method on the profiler's callback interface that is passed to NotifyOnObjectAllocations.

Syntax

HRESULT NotifyOnObjectAllocations(IObjectAllocationCallback *pioacb);

Parameters

[in] *pioacb A pointer to the IObjectAllocationCallback interface implemented by the profiler.

Remarks

If a memory profiler has registered a callback, the Microsoft VM will send a notification on each Java object that is allocated to a method on the profiler's IObjectAllocationCallback interface passed to this function. To stop receiving these notifications, a profiler must unregister this callback by calling a IObjectAllocationCallback method with a NULL pointer.

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