how to bring jvm to safepoint
Tony Guan
guanxiaohua at gmail.com
Thu Jul 29 14:29:11 PDT 2010
Dear all,
I want to invoke the GC at a certain time, for example, when a certain
method is called at runtime, so I created a new subtype of
VM_GC_Operation class, and initialized it with an object op, finally,
executed using:VMThread::execute(&op)
then I got the following error message:
# Internal Error
(/home/tony/software/OpenJDK/jdk7/hotspot/src/share/vm/runtime/thread.cpp:777),
pid=29652, tid=1096460624
# Error: Possible safepoint reached by thread that does not allow it
The reason for the fail is that
Thread::check_for_valid_safepoint_state() didn't pass because the
currentThread is not a VMThread.
My question is: how do I bring the current thread to a safepoint? or
how do I call a GC operation properly? is there any prerequisite for
doing so?
Thanks!
Tony (Xiaohua Guan)
More information about the hotspot-runtime-dev
mailing list