LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   help me resource usage (https://www.linuxquestions.org/questions/linux-general-1/help-me-resource-usage-94768/)

srinivasar 09-20-2003 04:53 AM

help me resource usage
 
Hi,

I am working on finding out my applications resource usage.

I tried to build a tool using java.
in that i executed the command ps -eo 'pcpu,rss,pid,ppid,args' to find the %cpu , memory usage.

My application spawn's 'n' no of threads. I need to consider all the thread's to find the resource usage.

With the above command , whether i am in the track or not.

Pl. help me in this regard.

Thanks

jailbait 09-20-2003 04:05 PM

"I need to consider all the thread's to find the resource usage."

I am not certain but I think that the ps command you describe will show the resource usage for all threads running under the same user ID as your Java program, not just the 'n' threads that your Java program spawned.

srinivasar 09-21-2003 03:18 AM

Thanks Steve ,

It's the case in solaris which will show the total resource usage as my parent application , but in linux it will show each thread as separate process.

If i am wrong correct me

Thanks for the reply

megaspaz 09-21-2003 03:44 AM

correct me if i'm wrong, but don't java apps just show up in ps as "java" so if more than one java app is running, how could you ever find out the usage of a particular java app?

srinivasar 09-21-2003 03:56 AM

Hi

having PGID in the ps command we can separate the several java applications.

PGID will be the pid of the parent process which spawn this process.

We can see the same using the following command
ps -eo 'pcpu,rss,pid,pgid,args'

Presently i am having doubt in finding the swapped out memory utilized by the application.

Memory Usage = rss + Swapped out memory.

Pl .let me know , if you know solution for the swapped memory.

Thanks


All times are GMT -5. The time now is 02:32 AM.