Okay, here's what I did....I wrote BrowserStarter.java:

public class BrowserStarter {
  public static final void main(String[] args) throws Exception {
    Runtime.getRuntime().exec(args[0]);
  }
}

It's actually very poorly named because, in fact, it can start whatever 
you want...ignore that little detail, though. :-)

Then, I changed the cmdline setting in jsl.ini to...

cmdline = -cp . BrowserStarter "java -jar 
org.eclipse.osgi_3.4.0.v20080605-1900.jar -console 8888"

So, effectively, this tells JSL to start a service that starts Equinox, 
listening on port 8888.

When I install and run the service, I get an initial spike, but then it 
settles back to 0% CPU usage. I prove that Equinox is running by 
telnet'ing to localhost port 8888.

This has me questioning that the problem might be with the call to 
exec(). But I include the code here in case you see something else that 
I might try.

But that's for tomorrow...my workday has ended and I'm going home now...





Alin Dreghiciu wrote:
> On Wed, Jul 30, 2008 at 11:02 PM, Craig Walls <[EMAIL PROTECTED]> wrote:
>   
>> I'm cooking up an example that uses System.exec (or actually...don't you
>> mean Runtime.getRuntime().exec()?). I'm about ready to try it on Windows
>> as a service.
>>     
>
> Yes.
>
>   
>> As for --noconsole, I've already tried that. It was originally part of
>> my jsl.ini before I started stripping it down to bare parts.
>>
>> BTW...is there any way to make Pax Runner completely silent? That
>> includes the PAX "logo"...I want it to be completely silent. Any way to
>> do that?
>>     
>
> No, but create a jira issue and I will implement it ASAP. The logo is
> printed always. The least output you can get is with option
> --log=NONE.
>
>   
>> Alin Dreghiciu wrote:
>>     
>>> Hi Craig,
>>>
>>> As Toni mentioned there is not to much life wthin Pax Runner after the
>>> target platform is stated.
>>> There are 3 things you can take into consideration:
>>> 1. Target platform is started in a new process with System.exec
>>> 2. There are 3 pipes that pipes the System.in/out/err to the started process
>>> 3. There is a shutdown hook installed.
>>>
>>> I cannot test your case as I do not have windows on my machine.
>>> But before doing anything else try first to add the following option
>>> to your cmdline: --noconsole
>>>
>>> On Wed, Jul 30, 2008 at 10:15 PM, Craig Walls <[EMAIL PROTECTED]> wrote:
>>>
>>>       
>>>> And now for something completely different...
>>>>
>>>> I'm trying to run Pax Runner (v0.12.0)-launched application as a Windows
>>>> service. I'm using JSL (http://jslwin.sourceforge.net/) to install and
>>>> run it as a service. It works, but when I start the service, the
>>>> performance tab in the task manager says that it's using 100% of the CPU!
>>>>
>>>> I've tried narrowing the problem down and I've finally reached a point
>>>> where I'm doing a VERY minimal installation of Pax Runner as a service
>>>> (my app isn't even involved anymore...nor are its dependency bundles).
>>>> Here's what the jsl.ini looks like:
>>>>
>>>>    [defines]
>>>>    PATH = c:\myapp
>>>>    JAVA = %JAVA_HOME%
>>>>    PP = %PATH%
>>>>    P1 = %P2%
>>>>    P2 = %PP%
>>>>    MYAPP_HOME = %PATH%
>>>>
>>>>    [service]
>>>>    appname = Semantra
>>>>    servicename = MyApp
>>>>    displayname = MyApp
>>>>    servicedescription = MyApp
>>>>    stringbuffer = 16000
>>>>    starttype=auto
>>>>    loadordergroup=someorder
>>>>    useconsolehandler=false
>>>>    stopclass=java/lang/System
>>>>    stopmethod=exit
>>>>    stopsignature=(I)V
>>>>    premainmethod=run
>>>>    premainsignature=()I
>>>>    premain.modules=threaddump
>>>>    premain.threaddump.class=com.roeschter.jsl.ThreadDumpListener
>>>>    premain.threaddump.method=start
>>>>    premain.threaddump.wait=3000
>>>>    premain.threaddump.critical=no
>>>>    premain.threaddump.interface=127.0.0.1
>>>>
>>>>    [java]
>>>>    cmdline = -jar %MYAPP_HOME%/bin/pax/pax-runner-0.12.0.jar --platform=eq
>>>>
>>>> The only thing non-trivial about running Pax Runner this way is that I'm
>>>> using Equinox instead of the default Felix (I get the same results with
>>>> Felix, btw).
>>>>
>>>> Again, nothing special...just a bare-bones Pax Runner. No bundles other
>>>> than the framework bundles are involved. When I start the service, the
>>>> CPU jumps to 100%. Actually, while it's resolving the framework bundles
>>>> from Maven, it stays relatively low (at around 40% or less)...but once
>>>> the framework starts, it plateaus at 100%.
>>>>
>>>> Note that I can run Pax Runner (with or without my app) as a non-service
>>>> and the CPU stabilizes after a brief startup spike. I can also run
>>>> Equinox (java -jar equinox.jar) as a service and the CPU usage remains
>>>> low. So, the culprit seems to be Pax Runner.
>>>>
>>>> I don't expect that anyone listening has tried doing this before, but I
>>>> have to ask: What could Pax Runner be doing after the framework starts
>>>> that would cause it to consume all of the CPU when running as a Window
>>>> service? Once the framework is started, what is there for Pax Runner to
>>>> do? Why so busy?
>>>>
>>>> And...anybody have any ideas on how I could run this as a service and
>>>> *not* use up all of the CPU?
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> 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

Reply via email to