On 05/11/06, Yahav Biran <[EMAIL PROTECTED]> wrote: Another question: it looks that the java processes are spawned to many java processes, how one can monitor it. I tried to top the processes and then use ps -H but the process is disappearing until I catch it.
Java uses lots of threads - for a start the Garbage Collector (GC) runs in its own thread. And that's even before you start writing real Java programs which are encouraged by the language to use multi-threading. What kernel version are you using? [Yahav Biran] 2.6.9-22.0.2 In LinuxThreads (up to 2.4) each thread has its own PID (actually it's an ugly hack using the internal mechanisms of fork(2) but leaving the virtual memory shared among the "kids", somewhat reminiscent of BSD's vfork(2)), under 2.6 and its support for proper POSIX threads, all threads appear to belong to the same process (have the same PID) and will only be displayed by ps(1) using -L (for instance), showing the LWP (Light Weight Process). They are listed under /proc/<pid>/task/<tid>. That (better thread support) is one of the best reasons to upgrade to 2.6 if you can and haven't done this yet, IMNSHO. If these threads appear and disappear too quickly then maybe there is a place for tuning here - by means of controlling the thread pool parameters (if possible). There are quite a few -X "undocumented" command line options for the Java VM which will allow you to trace thread creation and possibly influence thread management. RTFM java(1) and dig the net. BTW - which JVM are you using? [Yahav Biran] 1.4.2 Try to find which type of threads it uses. --Amos ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]