process uses up memory - which tools can detect?

Asked by sorcer

My process starts up 200 threads (over time) and each one gets (defaultly) 10 MB of stack. This totals 2 GB just for stack space, and the process eventualy dies.

I found this problem the hard way - by messing around with ulimit. I tried using vmastat, free, top, and looking at /proc/meminfo and /proc/slabinfo, but I didn't see any obvious changes in mem usage to point me to the (now obvious) problem that my threads were using up all the process memory with their stack space.

How can I see this problem develop? Am I using the wrong tools, or am I looking at the data wrong.. or the wrong data?

Thanks for any help

Steve

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Sidarth Dasari (sirsid) said :
#1

I use htop all the time for things like this. Have it order the processes in order of memory and you can see if anything starts using up too much. You can also kill it by pressing F9 which is very useful.

Revision history for this message
sorcer (sklekas) said :
#2

htop is like top, and on the system I'm using, I'm not seeing any indication of memory usage by the SIZE or RSS fields. These hardly change from before the 200 threads are spawned and after I know they are running. I'm wondering if top is broken..

Revision history for this message
Sidarth Dasari (sirsid) said :
#3

Press F6 while in htop to modify its order. Sorry If I have misunderstood your problem.

Can you help with this problem?

Provide an answer of your own, or ask sorcer for more information if necessary.

To post a message you must log in.