Reputation: 733
How can I get the memory details for a process running on linux? I need to find out specific details like stack size, heap size of a process.
Upvotes: 2
Views: 4044
Reputation: 191
For ubuntu: Grep returns only useful information $ java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
For windows: There is no grep in Windows, instead, we use findstr. C:>java -XX:+PrintFlagsFinal -version | findstr /i "HeapSize PermSize ThreadStackSize"
The -XX:+PrintCommandLineFlags is used to print out the values that modified by VM only
Upvotes: 0
Reputation: 80831
You will find everything about your process in the /proc/PID
directory. Especially in the smaps
file where you will find the stack and heap size currently used.
Upvotes: 3