diff --git a/src/share/vm/memory/genCollectedHeap.cpp b/src/share/vm/memory/genCollectedHeap.cpp index e25cc513158753a067601f17f2ec0b89ec1d4ec3..47a0602ec4f02fc73917a54703391480aa4a8aec 100644 --- a/src/share/vm/memory/genCollectedHeap.cpp +++ b/src/share/vm/memory/genCollectedHeap.cpp @@ -482,6 +482,10 @@ void GenCollectedHeap::do_collection(bool full, for (int i = starting_level; i <= max_level; i++) { if (_gens[i]->should_collect(full, size, is_tlab)) { if (i == n_gens() - 1) { // a major collection is to happen + if (!complete) { + // The full_collections increment was missed above. + increment_total_full_collections(); + } pre_full_gc_dump(); // do any pre full gc dumps } // Timer for individual generations. Last argument is false: no CR diff --git a/src/share/vm/prims/jvmtiExport.cpp b/src/share/vm/prims/jvmtiExport.cpp index 50ecb4b9559fab621e2b76fd82bca1801ae29fd5..7a5068b43b3c0332bd738ffa7fcc785bdf998ad8 100644 --- a/src/share/vm/prims/jvmtiExport.cpp +++ b/src/share/vm/prims/jvmtiExport.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2427,6 +2427,11 @@ JvmtiGCMarker::JvmtiGCMarker(bool full) : _full(full), _invocation_count(0) { return; } + if (ForceFullGCJVMTIEpilogues) { + // force 'Full GC' was done semantics for JVMTI GC epilogues + _full = true; + } + // GarbageCollectionStart event posted from VM thread - okay because // JVMTI is clear that the "world is stopped" and callback shouldn't // try to call into the VM. diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp index 781bc93aae540a73b8626d047b90389586585759..074ae68d9a292e04f0c5fccfcc9218cd066b2f65 100644 --- a/src/share/vm/runtime/globals.hpp +++ b/src/share/vm/runtime/globals.hpp @@ -1082,6 +1082,9 @@ class CommandLineFlags { product(ccstr, TraceJVMTI, NULL, \ "Trace flags for JVMTI functions and events") \ \ + product(bool, ForceFullGCJVMTIEpilogues, false, \ + "Force 'Full GC' was done semantics for JVMTI GC epilogues") \ + \ /* This option can change an EMCP method into an obsolete method. */ \ /* This can affect tests that except specific methods to be EMCP. */ \ /* This option should be used with caution. */ \