| PLEX86 | ||
|
ps o and Process CPU TimeAnkit Fadia : The real picture Dear All, Yesterday (03-04-2006)I attended a seminar by a so-called "Hacking Guru" Ankit Fadia, at DAVV, Indore (MP) auditorium. I just want to share my feelings with you... Hi Folks, I have a question regarding how `ps -o cputime` reports CPU time for a process. SLES9, service pack 2, stock SLES9 kernel 2.6.8 (if memory serves). Specifically, I have multiple Java virtual machines (Sun Java JRE-1.5.0) running on a system (in the form of a Java browser plugin) and I wish to calculate total CPU time for all running JVMs. I have a Perl script that calls `ps -o cputime,...` in a loop that iter- ates for as many times as there are JVMs running. Each time through the loop, I get the CPU time for the JVM process that the loop is currently looking at and add it to a running total. What I want to do is clarify that I can get accurate results via this method - that `ps` output is accurate and representative of total JVM CPU expenditure. Is this the case? One other thing. When exporting $DISPLAY from the DL-380 to, say, 9 remote X servers and starting 9 different browser sessions on those remote disp- lays, `ps -e grep javavm wc -l` often reports 200+ instances of running javajvm. I'm guessing that what I'm seeing here is the JRE spawning threads like crazy. Does this sound normal? I would also want to do the above CPU time calculation with ps for Any feedback would be appreciated. Thanks, Josh.
|
||||