LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-27-2008, 01:39 PM   #1
sorcer
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Rep: Reputation: 0
Question process threads/stacks use up memory - which tools can detect?


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 eventually 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 these tools don't seem to show that my address space (2 GB per process, right?) is being used up by the thread's stack. I looked at top output before and after the threads were started, and saw very little change. The other tools/data were inconclusive as well.

Any ideas concerning how a problem like this could be detected w/o having to guess at sizes? For example, figuring out 'ulimit -s unlimited' actually -reduced- the size of the allocated stack from 10 MB (the default on RH) to 2 MB took a while to detect.

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

Thanks for any help

Steve

Last edited by sorcer; 05-27-2008 at 03:31 PM.
 
Old 05-27-2008, 03:28 PM   #2
sorcer
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sorcer View Post
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 eventually 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 these tools don't seem to show that my address space (2 GB per process, right?) is being used up by the thread's stack. I looked at top output before and after the threads were started, and saw very little change. The other tools/data were inconclusive as well.

Any ideas concerning how a problem like this could be detected w/o having to guess at sizes? For example, figuring out 'ulimit -s unlimited' actually -reduced- the size of the allocated stack from 10 MB (the default on RH) to 2 MB took a while to detect.

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
BUMP. I'm still getting, e.g., sig 11, and crashes all over. During problem periods, the process restarts and fails quickly. I'm pretty sure it is a resource problem, but I need proof. Any help is greatly appreciated. Thanks.

Steve.
 
  


Reply

Tags
debug, stack



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tool to detect number of memory slots, memory module type, speed, and size stefanwolf Linux - Hardware 8 04-22-2013 09:48 AM
LXer: This week at LWN: Memory part 7: Memory performance tools LXer Syndicated Linux News 0 11-22-2007 08:51 AM
what happens to threads if i kill the process ? psh2001 Programming 4 08-11-2007 11:21 PM
How to View Threads per Process Shashi Linux - Software 0 08-01-2003 01:37 AM
Threads And Process Penguinizer Programming 1 02-18-2003 09:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration