Runtime.exec() is slow

V

vol30w60

Does anyone know why runtime.exec() would be slow in launching an
application. I am using the method given here:

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4

My application does launch, but it takes about 15 seconds before it is
able to accept input. Normally, it would only take a couple seconds to
start up from Windows.

I also tried Legend_Keeper's code found on this page, but there was no
change in start-up time:
http://forum.java.sun.com/thread.jspa?threadID=591948&messageID=3091096
 
R

Roedy Green

My application does launch, but it takes about 15 seconds before it is
able to accept input. Normally, it would only take a couple seconds to
start up from Windows.

See if you can get your app to do something VERY early on in the load
process, like display a splash screen.

Some things that may be slowing it down:

1. RAM is already filled to the gills with the spawning Java app. That
all has to be paged out page by page to make room for the new app. See
what happens when you run this on a ram-rich machine. See what you
can do to reduce your spawner's ram footprint prior to spawn. In the
DOS days, I would have the spawner roll itself out to disk leaving
just a tiny stub in ram, spawn the child, then roll ram back in. This
should happen as a side effect of the paging system today, but not as
efficiently since the page out happens gradually.


2. Perhaps the APP is waiting for something. Is the spawner holding
on to a file?

3. Use a fully qualified *.exe name so there is no need to chase the
path. Use an explicit .exe.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,121
Latest member
LowellMcGu
Top