How to limit JProfiler to a subtree -


i have method called com.acmesoftware.shared.abstractderrivedbean.getderiveduniqueid(). when jprofiler application, method, getderiveduniqueid(), buried 80 methods deep expected. method invoked on behalf of every bean in application. i'm trying record cpu calltree starting method down leaf node (ie, 1 of excluded classes).

i tried following didn't produce expected outcome:

  1. find method above method targeted profiling, eg, markfordeletion().
  2. set trigger start recording @ getderiveduniqueid()
  3. set trigger stop recording @ markfordeletion()

i expecting see below markfordeletion(), saw not including getderiveduniqueid(), opposite of intended goal. worse yet, 5ms sampling, trigger increased previous running time 10 minutes "i terminated after 3 hours of running". seems trigger adding giant amount of overhead on top of overhead. hence, if figure out how correctly enable trigger, added overhead seem render ineffective.

the reason need limit recording method is: when running in 5ms sampling mode, application completes in 10 minutes. when run in full instrumentation, i've waited 3 hours , still hasn't completed. hence, need turn on full instrumentation after getderiveduniqueid() invoked , pause profiling when getderiveduniqueid() exited.

-- updated/edit: thank ingo kegel assistance. not clear on how use triggers. in code below, set triggers shown after code. expectation when jprofile application (both sampling , full instrumentation) below configured triggers, if boolean iscollectmetrics false, should see 100% or 99.9% of cpu in filtered classes. however, not case. cpu tree seems not take account triggers. secondly, when iscollectmetrics true, jprofiler call tree expect start startprofiling() , end @ stopprofiling(). again, not case either.

the method contains() bottleneck. calls 1 of 150 getderiveduniqueid(). trying pinpoint getderiveduniqueid() causing performance degradation.

public static final atomiclong doequalcontenttime = new atomiclong(); public static final atomiclong instcount = new atomiclong();  protected boolean contentsequal(final instancesetvalue that) {      if (iscollectmetrics) {          // initialization code removed clarity         // ..........         // ..........          final set<instance> c1 = getreferences();         final set<instance> c2 = that.getreferences();         long st = startprofiling();    ///  <-------  start here         (final instance inst : c1) {             instcount.incrementandget();             if (!c2.contains(inst)) {                 long et = stopprofiling();    ///  <-------  stop here                 doequalcontenttime.addandget(et - st);                 return false;             }         }          long et = stopprofiling();    ///  <-------  stop here         doequalcontenttime.addandget(et - st);         return true;     } else {         // same code path above w/o profiling. code removed bravity.         // ......         // ......         return true;     } }  public long startprofiling() {     return system.nanotime(); }  public long stopprofiling() {     return system.nanotime(); }  public static void reset() {     doequalcontenttime.set(0);     instcount.set(0); } 

the enabled triggers: enter image description here

startprofiling trigger: enter image description here

stopprofiling trigger: enter image description here

i've tried 'start recordings' or 'record cpu' buttons separately capture call tree enter image description here

if overhead instrumentation large, should refine filters. filters, instrumentation overhead can small,

as trigger setup, correct actions are:

  1. "start recording" cpu data selected
  2. "wait event finish"
  3. "stop recording" cpu data selected

Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -