jQuery in Action, 3rd edition
The moose likes Linux / UNIX and the fly likes memory usage per process Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "memory usage per process" Watch "memory usage per process" New topic

memory usage per process

Reda Mokrane
Ranch Hand

Joined: Jul 25, 2001
Posts: 237
how can I get memory usage per process in linux?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42956
Do you mean manually of programmatically? The "top" command lists all processes with their real and virtual memory allocations. You could run that from within Java using Runtime.exec and parse its output for the values you're interested in.
Reda Mokrane
Ranch Hand

Joined: Jul 25, 2001
Posts: 237

I mean manually, I have 3 processes running and i want to find out the memory/cpu usage for each.
I agree. Here's the link: http://aspose.com/file-tools
subject: memory usage per process
It's not a secret anymore!