Microsoft SDK for Java

IObjectAllocationCallback::
OnObjectAllocated

The OnObjectAllocated method of the IObjectAllocationCallback interface is called by the Microsoft VM to notify the memory profiler when an individual object is created (allocated on the heap). These objects can be either an instance of a class or an array. The Microsoft VM passes in the ObjectID and the ClassID of the object. The ClassID is the class type of the newly created instance.

This method should return S_OK.

Syntax

HRESULT OnObjectAllocated(ObjectID object_id, ClassID class_id);

Parameters

[in] object_id The ObjectID of the object created.
[in] class_id A ClassID of the object being created.

Remarks

The profiler can call the ClassInformation method implemented by the Microsoft VM to retrieve class information about this object. In particular, if the class name begins with a left bracket ([), this object is an array object.

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