LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-30-2010, 02:55 AM   #1
sathyadurai
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Rep: Reputation: 0
How to find the memory usage of shared library running in Linux?


I need to find the memory usage of a shared library loaded in Linux environment.

I need this information for deciding on whether to make the library part in to application or a seperate application itself.
 
Old 11-30-2010, 03:33 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Take a look at /proc/<pid>/smaps. It reports the memory usage for each shared object loaded in memory. Please, see man proc for details.
 
Old 11-30-2010, 11:24 PM   #3
sathyadurai
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Original Poster
Rep: Reputation: 0
/proc/pid/smaps and pmap command are not giving the complete size occupied by a shared library. The size depends on the methods from shared lib that are currently attached to the process.
 
Old 12-01-2010, 02:15 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Hmmm... maybe it's necessary some more sophisticated tool like memprof, valgrind or exmap. I have no experience with these tools, anyway.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Linux Shared Memory Usage kam2630 Programming 5 03-25-2009 02:56 PM
usage of shared memory dianarani Linux - Hardware 1 10-16-2007 03:12 PM
trying to find which package has shared library BashTin Slackware 4 06-12-2007 07:30 AM
how to find max memory usage for process in Linux by command line kashameni Linux - Newbie 9 06-01-2007 01:39 AM
how to find what shared library is in memory Patrick Bulteel AIX 3 10-26-2005 10:35 AM


All times are GMT -5. The time now is 10:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration