Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
show linux memory used by process
clippie_dippie
follow
0
11-3-2009 4:51 AM
31 views
tags:
linux
,
memory
,
profile
,
debug
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Today's Top Clips
These killers don't deserve the rights of Americans
Glenn kicks a bit o butt
CAN YOU SEE THE CUTE NOW?
Facts about Animals
The Human Brain
Islam and Thanksgiving
Obama Playbook
DOGS ARE A MAN'S BEST FRIEND?
Obama says he expects you to support the war; his rationale will convince you
Obama Quietly Backs Patriot Act Provisions
visit the
Top Clips page
View the Top Clips from
November 3, 2009
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/363e1550-da31-4466-af45-7286cb50c5d1/0CC09BAF-A414-40AB-896A-2EF819F4674B/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://stackoverflow.com/questions/131303/linux-how-to-measure-actual-memory-usage-of-an-application-or-process/1237930#1237930" href="http://stackoverflow.com/questions/131303/linux-how-to-measure-actual-memory-usage-of-an-application-or-process/1237930#1237930" style="font-size: 11px;">stackoverflow.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://stackoverflow.com/questions/131303/linux-how-to-measure-actual-memory-usage-of-an-application-or-process/1237930#1237930"><DIV class="answer" id="answer-1237930"> <TABLE><TBODY><TR><TD class="votecell"><DIV class="vote"> <INPUT type="hidden" value="1237930" /> <IMG width="40" height="25" title="This answer is useful (click again to undo)" alt="vote up" src="http://sstatic.net/so/img/vote-arrow-up.png" class="vote-up" /> <SPAN class="vote-count-post"> 1 </SPAN> <IMG width="40" height="25" title="This answer is not useful (click again to undo)" alt="vote down" src="http://sstatic.net/so/img/vote-arrow-down.png" class="vote-down" /> </DIV> </TD><TD><DIV class="post-text"><P>In recent versions of linux, use the <EM>smaps</EM> subsystem. For example, for a process with a PID of 1234:</p> <PRE class="prettyprint"><CODE><SPAN class="pln">cat </SPAN><SPAN class="pun">/</SPAN><SPAN class="pln">proc</SPAN><SPAN class="pun">/</SPAN><SPAN class="lit">1234</SPAN><SPAN class="pun">/</SPAN><SPAN class="pln">smaps<BR /></SPAN></CODE></PRE> <P>It will tell you exactly how much <B>memory</B> it is using at that time. More importantly, it will divide the <B>memory</B> into private and <B>shared</B>, so you can tell how much <B>memory</B> your <EM>instance</EM> of the program is using, without including <B>memory</B> <B>shared</B> between multiple instances of the program.</p> </DIV> <TABLE class="fw"><TBODY><TR><TD class="vt"><DIV class="post-menu"><A title="permalink to this answer" href="http://stackoverflow.com/questions/131303/linux-how-to-measure-actual-memory-usage-of-an-application-or-process/1237930#1237930">link</A><SPAN class="link-separator">|</SPAN><A title="flag this post for serious problems" id="flag-post-1237930">flag</A></DIV> </TD><TD align="right" class="post-signature"><DIV class="user-info"><DIV class="user-action-time">answered <SPAN class="relativetime" title="2009-08-06 09:43:38Z">Aug 6 at 9:43</SPAN></DIV><DIV class="user-gravatar32"><A href="http://stackoverflow.com/users/104021/paul-biggar"><IMG width="32" height="32" alt="" src="http://www.gravatar.com/avatar/eee6ec3be3e3176ff1e1119301630812?s=32&d=identicon&r=PG" /></A></DIV><DIV class="user-details"><A href="http://stackoverflow.com/users/104021/paul-biggar">Paul Biggar</A><BR /><SPAN title="reputation score" class="reputation-score">1,697</SPAN><SPAN title="2 silver badges"><SPAN class="badge2">●</SPAN><SPAN class="badgecount">2</SPAN></SPAN><SPAN title="15 bronze badges"><SPAN class="badge3">●</SPAN><SPAN class="badgecount">15</SPAN></SPAN></DIV></DIV> </TD></TR></TBODY></TABLE></TD></TR><TR><TD class="votecell"></TD><TD><DIV class="post-comments"> <DIV class="display-none comments-container" id="comments-1237930"> <DIV class="comments"> </DIV> </DIV> </DIV> </TD></TR></TBODY></TABLE></DIV></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/0CC09BAF-A414-40AB-896A-2EF819F4674B/blog/" title="blog or email this clip"><img src="http://content9.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
New from the makers of Clipmarks:
Amplify.com - Don't just share the news...Amplify it!
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Copyright
Privacy
EULA
OK