Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

why jvm crashes if I invoke GC every 20000 allocations

843829Apr 8 2006 — edited Apr 11 2006
I am doing a project related to object's lifetime. I modified JVM code to force it to do garbage collection every 20000 allocations (i.e., every 20000 objects have been allocated). In my code, I used a global variable total_objs to track how many objects have been allocated so far.
I added the following code at every allocation time ( in function jvmpi_object_alloc() of universe.cpp)

if( total_objs% GCFreq == 0) //GCFreq=20000 here
Universe::heap()->collect(GCCause::_java_lang_system_gc);
}

But JVM will always failed. Even I enlarge GCFreq, VM still crashed. Why????????

Feng
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 9 2006
Added on Apr 8 2006
1 comment
120 views