이 글을 읽었을 때 자바 프로파일 러가 존재하기 때문에 이런 종류의 정보를 얻는 방법이 필요하다고 생각했습니다. 아마도 이것은 도움이 될 것입니다 : http://java.sun.com/j2se/1.4.2/docs/guide/jvmpi/jvmpi.html. JVM과 프로파일 러 에이전트 간의 인터페이스를 설명합니다. 그러나 실제로 Java에서이 글을 쓰고 싶다면 운이 좋지 않을 수 있습니다. Eclipse에서
jint (*EnableEvent)(jint event_type, void *arg);
Called by the profiler agent to enable notification of a particular type of event. Apart from event_type, the profiler may also pass an argument that provides additional information specific to the given event type.
All events are disabled when the VM starts up. Once enabled, an event stays enabled until it is explicitly disabled.
This function returns JVMPI_NOT_AVAILABLE if event_type is JVMPI_EVENT_HEAP_DUMP, JVMPI_EVENT_MONITOR_DUMP or JVMPI_EVENT_OBJECT_DUMP. The profiler agent must use the RequestEvent function to request these events.
Arguments:
event_type - type of event, JVMPI_EVENT_CLASS_LOAD etc.
arg - event specific argument.
Returns:
JVMPI_SUCCESS enable succeeded.
JVMPI_FAIL enable failed.
JVMPI_NOT_AVAILABLE support for enabling the given event_type is not available.
WeakReferences (http://java.sun.com/javase/6/docs/api/java/lang/ref/WeakReference.html)를 사용하면 지주 포인터가 실제로 외설스럽지 않습니다. –