First, let me admit a bit of ignorance when it comes to profiling tools. I've used them before, but I never feel like I really know what I'm doing. That said...
I have been unsuccessful in getting JProfiler to profile Pax Runner running as a Windows Service. But I have been able to run it as a standalone program (well...sorta...I'm using "jsl -debug" to run Pax Runner from the jsl.ini configuration). What I seemed to have learned (from the "Hotspots" tab) is... 66.1% of the time is spent in java.io.InputStream.read() with the bulk of that time in org.ops4j.pax.runner.platform.internal.Pipe.run(). 33.1% of the time is spent in java.lang.Process.waitFor() 0.1% of the time is spent in java.util.jar.JarFile.getManifest() What's also interesting (at least as much as I can tell) is that all of that time spent in org.ops4j.pax.runner.platform.internal.Pipe.run() doesn't take place until after the platform has been started (the same time that my CPU gets bombarded). Note again, however, that this profile was against the Pax Runner running standalone (not as a Windows service). I do not have the same CPU problems when I run it this way. But as a service, it hits 100% CPU just about the same time that the platform starts. Unfortunately, the service won't even start when I have it set to run with JProfiler. FWIW, here's the cmdline I'm giving to jsl.ini: cmdline = -Xbootclasspath/a:C:/semantra/bin/agent.jar -agentlib:jprofilerti -jar c:/semantra/bin/pax/pax-runner-0.12.0.jar --platform=eq --noConsole --log=NONE I'll keep trying to start it as a service. Alin Dreghiciu wrote: > On Thu, Jul 31, 2008 at 4:22 PM, Craig Walls <[EMAIL PROTECTED]> wrote: > >> Where may I find that O/S license for JProfiler? >> > > svn co https://scm.ops4j.org/repos/ops4j/projects/community/licenses > > >> And (if you happen to know), can JProfiler profile Pax Runner no matter >> how it is run? I don't know much about JProfiler, but it's kinda >> important that I profile it while it is running as a service...I don't >> run into the CPU consumption problem if I run it in a normal way. >> > > You should look for remote profiling, meaning that JProfiler will > attach to Pax Runner not that JProfiler will start pax runner. Like fr > remote debugging. But I never profiled a java app started as a > service. I guess that you have to do something liek explained into Pax > Runner FAQ: http://wiki.ops4j.org/confluence/x/UwBH (bottom of the > page) only that the vm args should be now set for pax rnner not for > the started process. Anyhow ehen you will start up JProfiler and > create a remote session he will give you instructions about what are > you supposed to to (when starting JProfiler create a new session and > look for "new remote integration"). > > >> >> Alin Dreghiciu wrote: >> >>> Looks like the only thing is not there now is the shutdown hook. which >>> is a simple thread that stops the pipes and destroys the started >>> process. >>> But, can't we figure out what is the tread that is consuming the CPU >>> using a java profiler? We have an open source license for JProfiler. >>> >>> On Thu, Jul 31, 2008 at 3:27 PM, Craig Walls <[EMAIL PROTECTED]> wrote: >>> >>> >>>> So far, no good. Here's what BrowserStarter.java looks like now: >>>> >>>> import org.ops4j.pax.runner.platform.internal.Pipe; >>>> >>>> public class BrowserStarter { >>>> static Pipe err; >>>> static Pipe out; >>>> static Pipe in; >>>> >>>> >>>> public static final void main(String[] args) throws Exception { >>>> try { >>>> Process p = Runtime.getRuntime().exec(args[0]); >>>> p.waitFor(); >>>> >>>> err = new Pipe( p.getErrorStream(), System.err ).start( "error" ); >>>> out = new Pipe( p.getInputStream(), System.out ).start( "out" ); >>>> in = new Pipe( p.getOutputStream(), System.in ).start( "in" ); >>>> } finally { >>>> if(err != null) err.stop(); >>>> if(out != null) out.stop(); >>>> if(in != null) in.stop(); >>>> } >>>> } >>>> } >>>> >>>> And my jsl.ini's cmdline looks like this: >>>> >>>> cmdline = -cp c:/semantra/bin;c:/semantra/bin/pax/pax-runner-0.12.0.jar >>>> BrowserStarter "java -jar >>>> c:/semantra/bin/org.eclipse.osgi_3.4.0.v20080605-1900.jar -console 8888" >>>> >>>> As before, when I start the service, there's a small spike (about 40% or >>>> so), then it settles back down to 0%. Of course, that's a good thing, >>>> except that it does nothing to explain why Pax Runner starts up as a >>>> service consuming 100% of the CPU. >>>> >>>> I'm still tinkering and looking around at Pax Runner source on my end to >>>> see if I can figure it out. But I wanted to report the status of this >>>> experiment to see if you guys have any ideas. >>>> >>>> >>>> >>>> Niclas Hedhman wrote: >>>> >>>> >>>>> On Thursday 31 July 2008 05:44, Craig Walls wrote: >>>>> >>>>> >>>>> >>>>>> public class BrowserStarter { >>>>>> public static final void main(String[] args) throws Exception { >>>>>> Runtime.getRuntime().exec(args[0]); >>>>>> } >>>>>> } >>>>>> >>>>>> >>>>>> >>>>> I am also not on Windows (who uses that anyway? ;-) ) >>>>> >>>>> Perhaps change to; >>>>> >>>>> public class BrowserStarter { >>>>> public static final void main(String[] args) throws Exception { >>>>> Process p = Runtime.getRuntime().exec(args[0]); >>>>> p.waitFor(); >>>>> } >>>>> } >>>>> >>>>> And if that doesn't do it, look up the Pipe class in Pax Runner and add >>>>> that >>>>> by; >>>>> >>>>> static Pipe err; >>>>> static Pipe out; >>>>> static Pipe in; >>>>> >>>>> err = new Pipe( process.getErrorStream(), System.err ).start( "error" ); >>>>> out = new Pipe( process.getInputStream(), System.out ).start( "out" ); >>>>> in = new Pipe( process.getOutputStream(), System.in ).start( "in" ); >>>>> >>>>> and the Shutdown hook to cleanup properly. >>>>> >>>>> >>>>> Cheers >>>>> >>>>> >>>>> >>>> _______________________________________________ >>>> general mailing list >>>> general@lists.ops4j.org >>>> http://lists.ops4j.org/mailman/listinfo/general >>>> >>>> >>>> >>> >>> >>> >> _______________________________________________ >> general mailing list >> general@lists.ops4j.org >> http://lists.ops4j.org/mailman/listinfo/general >> >> > > > > _______________________________________________ general mailing list general@lists.ops4j.org http://lists.ops4j.org/mailman/listinfo/general