< prev index next >

src/hotspot/share/jfr/leakprofiler/leakProfiler.cpp

Print this page

 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "jfr/leakprofiler/leakProfiler.hpp"
 26 #include "jfr/leakprofiler/startOperation.hpp"
 27 #include "jfr/leakprofiler/stopOperation.hpp"
 28 #include "jfr/leakprofiler/checkpoint/eventEmitter.hpp"
 29 #include "jfr/leakprofiler/sampling/objectSampler.hpp"
 30 #include "jfr/recorder/service/jfrOptionSet.hpp"
 31 #include "logging/log.hpp"
 32 #include "memory/iterator.hpp"
 33 #include "runtime/javaThread.inline.hpp"
 34 #include "runtime/vmThread.hpp"
 35 
 36 bool LeakProfiler::is_supported() {
 37   if (UseShenandoahGC) {
 38     // Leak Profiler uses mark words in the ways that might interfere
 39     // with concurrent GC uses of them. This affects Shenandoah.



 40     return false;
 41   }
 42   return true;
 43 }
 44 
 45 bool LeakProfiler::is_running() {
 46   return ObjectSampler::is_created();
 47 }
 48 
 49 bool LeakProfiler::start(int sample_count) {
 50   if (is_running()) {
 51     return true;
 52   }
 53 
 54   // Allows user to disable leak profiler on command line by setting queue size to zero.
 55   if (sample_count == 0) {
 56     return false;
 57   }
 58 
 59   // Exit cleanly if not supported

 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "jfr/leakprofiler/leakProfiler.hpp"
 26 #include "jfr/leakprofiler/startOperation.hpp"
 27 #include "jfr/leakprofiler/stopOperation.hpp"
 28 #include "jfr/leakprofiler/checkpoint/eventEmitter.hpp"
 29 #include "jfr/leakprofiler/sampling/objectSampler.hpp"
 30 #include "jfr/recorder/service/jfrOptionSet.hpp"
 31 #include "logging/log.hpp"
 32 #include "memory/iterator.hpp"
 33 #include "runtime/javaThread.inline.hpp"
 34 #include "runtime/vmThread.hpp"
 35 
 36 bool LeakProfiler::is_supported() {
 37   if (UseCompactObjectHeaders || UseShenandoahGC) {
 38     // 1. With a 32-bit mark word in Lilliput2, we don't have enough unused
 39     //    bits to store edge index information in the mark word
 40     // 2. Even without compressed object headers, with Shenandoah, we don't
 41     //    have enough free bits in the mark word because of needing that
 42     //    space for forwarding pointers in the evacuation & update refs phase.
 43     return false;
 44   }
 45   return true;
 46 }
 47 
 48 bool LeakProfiler::is_running() {
 49   return ObjectSampler::is_created();
 50 }
 51 
 52 bool LeakProfiler::start(int sample_count) {
 53   if (is_running()) {
 54     return true;
 55   }
 56 
 57   // Allows user to disable leak profiler on command line by setting queue size to zero.
 58   if (sample_count == 0) {
 59     return false;
 60   }
 61 
 62   // Exit cleanly if not supported
< prev index next >