How to profile

Step by Step:

  • To profile in the OSGI context one will need to use the NetBeans profiler. First, calibrate your profiler if you haven't done so yet (Profile -> Advanced Commands -> Run Profiler Calibration).
  • Then click on the profiler button (stopwatch with a green triangle) and select "attach profiler" from the drop down list. 
  • Select Application when asked for the type, leave the rest alone (debug locally). In the next screen select Java 1.6. Now copy the agentpath and start up a console.
  • Enter:
    java -Dorg.osgi.framework.bootdelegation=org.netbeans.lib.profiler.server,org.netbeans.lib.profiler.server.\* -thingYouJustCopied -jar linkToYourJar.jar
  • Now you can finish attaching the profiler in netbeans and you should be good to go. 

Info:

Adding the following argument

-Dorg.osgi.framework.bootdelegation=org.netbeans.lib.profiler.server,org.netbeans.lib.profiler.server.\*

is necessary so that classes are visible within OSGi (otherwise youll' get: java.lang.NoClassDefFoundError: org/netbeans/lib/profiler/server/ProfilerRuntimeCPUFullInstr)

Labels

 
(None)