LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Stack usage of an application (https://www.linuxquestions.org/questions/linux-software-2/stack-usage-of-an-application-444602/)

tsenthilt 05-14-2006 03:33 AM

Stack usage of an application
 
Dear Team,
I would like find a maximum stack usage of an application. Kindly let me know how it is possible. I hope are there are some standard tool/solution available for it. Please reply me back.
Thanking you,
T.Senthil Nathan

taxtropel 05-14-2006 03:44 AM

you do so with the ulimit command
see the bash man page

tsenthilt 05-14-2006 04:16 AM

Dear Mr.taxtropel & Linux users
I just saw the man page of ulimit with stack usages, it is just displaying the maximum allowable limit for an application. Sorry my question is, how do you find, how much stack is used/utilized by an application with in the given limit. Kindly reply me back.
Thanking you,
T.Senthil Nathan.

taxtropel 05-14-2006 05:36 AM

reply, oh, that's easy...first you need to find the programs PID
(process ID)

do that with ps
Code:

ps -A
will give you the PID for ALL process running on the entire system

next go to the /proc folder
Code:

cd /proc
then enter the folder which matches the PID

Code:

cd 17109
then view the status file for that process

Code:

cat status
it will look something like this...

Code:

Name:  X
State:  S (sleeping)
SleepAVG:      98%
Tgid:  17109
Pid:    17109
PPid:  17107
TracerPid:      0
Uid:    0      0      0      0
Gid:    0      0      0      0
FDSize: 256
Groups:
VmPeak:  354104 kB
VmSize:  167596 kB
VmLck:      104 kB
VmHWM:    198224 kB
VmRSS:    142208 kB
VmData:  153828 kB
VmStk:        96 kB
VmExe:      1580 kB
VmLib:      9804 kB
VmPTE:      332 kB
Threads:        1
SigQ:  0/6141
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000000001000
SigCgt: 00000000518066cb
CapInh: 0000000000000000
CapPrm: 00000000fffffeff
CapEff: 00000000fffffeff

the stack is listed as "VmStk"

hope this helps

tsenthilt 05-14-2006 05:57 AM

Ok, is it a peak usage of stack or the current utilization of stack ?. Any way I would like to know the peak utilization of stack. It would be better, if it displays in terms of byte level granularity.
Thanking you,
T.Senthil Nathan.

tsenthilt 05-14-2006 10:09 AM

Dear Mr.taxtropel & Linux users,
Basically I would like to plot a graph which contains time in X-Axis and Stack usage in Y-Axis over the time. Please let me know how you can track the stack usage for an application over the time, the application may run only for few milliseconds. Kindly reply me back ASAP.
Thanking you,
T.Senthil Nathan.


All times are GMT -5. The time now is 08:44 PM.