Forums Register Login

problem with Runtime.exec()

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
 

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
+Pie Number of slices to send: Send
Just by the way:
ps -C java is more efficient than ps -ef | grep java - i.e. the grep java might find itself.
+Pie Number of slices to send: Send
The montoring program will run in a while loop and will check the status every 60 secs
+Pie Number of slices to send: Send
"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
This. Exactly this. This is what my therapist has been talking about. And now with a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1358 times.
Similar Threads
Can you assign unique thread ids and access thread from external program?
I/O binary piping ? Please Help !
Runtime.exec()
Monitoring script
Starting a java process via servlet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 20:38:13.