Re: help with huge memory consumption??



"Bin Chen" <binary.chen@xxxxxxxxx> wrote in news:1172800927.866571.297090
@8g2000cwh.googlegroups.com:

On 3ÔÂ2ÈÕ, ÉÏÎç9ʱ38·Ö, Dan Miller <d...@xxxxxxxxxxxxxxx> wrote:
I'm running a utility on kernel 2.6. When I run "ps aux", it shows my
utility as using 109MB of memory!!

root 5817 5.3 0.2 109132 1172 ? Ssl 18:01 1:23
/usr/src/ip3/shad

Total 197535

which is only about 200KB even with debug functions. I have no
explicit
malloc or new calls, I open 3 pthreads and one message queue.

I'm trying to figure out where all this memory is getting eaten up!!
I tried looking at /proc/`pidof shad`/status, and it shows
VmData: 106772 kB
which clearly is where my memory is consumed, but I don't know how to
break this down any further.

I've tried running objdump against the utility, but it just documents
essentially the same thing that 'size' does.

Is there anything else I can do to somehow enumerate this memory
usage??

There is a possibility that a dynamic library that you linked with
consume a lot of memory, check what libraries that your utility has
linked with by 'ldd'.

hmmm... that was interesting, but doesn't show memory usage of the
libraries:
linux-gate.so.1 => (0xffffe000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x4002c000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x4003f000)
libm.so.6 => /lib/tls/libm.so.6 (0x400fd000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40120000)
libc.so.6 => /lib/tls/libc.so.6 (0x40128000)
/lib/ld-linux.so.2 (0x40000000)

(BTW, I tell a lie; in this case, I have 14 pthreads running...)

Also, the proc status output shows
VmLib: 2128 kB
Isn't that the library usage?? Or is that just static library usage??




----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
.



Relevant Pages

  • Re: help a beginner with a basic function that should return a char
    ... anything to run without string literals unless they have a supercomputer at ... Note that you ignored the main question as to whether all of this memory ... You are one who is so concerned about efficiency and resource usage. ... Executables and libraries are paged in as needed. ...
    (comp.lang.c)
  • Re: word
    ... > The longer I use Word the more memory is seems to consume. ... I'm running 2003 and I've just fired it up and the usage is about ... RAM that the latter application uses. ...
    (microsoft.public.office.misc)
  • Re: W3WP memory usage
    ... You may be correct regarding the libraries using the lion's share of memory. ... > I am quite aware that Sharepoint files are stored in the database. ... >>> public class SPVersion ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Will a large library cause WMP10 to slow system to a halt?
    ... 704 Megabytes Installed Memory ... of case likely would slow nearly everything down - not just the WMP. ... I have 2 250 Gb drives in a RAID 1 ... If you don't use libraries, how do you play music in WMP? ...
    (microsoft.public.windowsmedia.player)
  • Re: [RFC 0/3] Recursive reclaim (on __PF_MEMALLOC)
    ... Once the memory requirements of a userspace daemon ... Yes, and also inspect the code to ensure it doesn't violate mlock_all by execing programs, dynamically loading libraries, etc. ... In nbd-server, there's no dlopen, and I do not currently plan to add ... Avoiding glib is a good start. ...
    (Linux-Kernel)