aspose file tools*
The moose likes Performance and the fly likes problem with Runtime.exec() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "problem with Runtime.exec()" Watch "problem with Runtime.exec()" New topic
Author

problem with Runtime.exec()

prashanthNair
Greenhorn

Joined: May 13, 2004
Posts: 18
I have a process monitoring program in linux which
executes the class through Runtime.exec()
and monitors the status of the child processes
periodically from a Thread.i am looking up
the processes from an rmi registry and will
write the status periodically.


when a "ps -ef | grep java" is done from the
terminal,it was showing 3 process ids.One for
the monitoring Main class,another for rmiregistry
and the third for the program which is being monitored

If i start this monitoring program ,its
observed that the system becomes slow.
I am not able to find out why is this happening
Is it because i am starting another jvm instance?

cheers
prashanth
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Is it because i am starting another jvm instance?

Starting another jvm instance would only cause a temporary pause.
I suspect your problem lies elsewhere - how frequently does your monitoring program run?
Bill
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Just by the way:
ps -C java is more efficient than ps -ef | grep java - i.e. the grep java might find itself.


http://home.arcor.de/hirnstrom/bewerbung
prashanthNair
Greenhorn

Joined: May 13, 2004
Posts: 18
The montoring program will run in a while loop and will check the status every 60 secs
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61768
    
  67

"prasanthNair",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with Runtime.exec()