Re: help with huge memory consumption??



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

Yet "size -A" shows:
size -A shad
shad :
section size addr
.interp 19 134512980
.note.ABI-tag 32 134513000
.note.SuSE 24 134513032
.hash 576 134513056
.dynsym 1200 134513632
.dynstr 738 134514832
.gnu.version 150 134515570
.gnu.version_r 240 134515720
.rel.dyn 24 134515960
.rel.plt 552 134515984
.init 23 134516536
.plt 1120 134516560
.text 62932 134517680
.fini 26 134580612
.rodata 8986 134580640
.eh_frame_hdr 508 134589628
.eh_frame 2636 134590136
.ctors 12 134596868
.dtors 8 134596880
.jcr 4 134596888
.dynamic 232 134596892
.got 4 134597124
.got.plt 288 134597128
.data 64 134597416
.bss 45952 134597504
.comment 742 0
.debug_aranges 344 0
.debug_pubnames 2210 0
.debug_info 35545 0
.debug_abbrev 5428 0
.debug_line 5319 0
.debug_frame 3516 0
.debug_str 9052 0
.debug_loc 9005 0
.debug_ranges 24 0
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'.


.



Relevant Pages

  • help with huge memory consumption??
    ... I'm running a utility on kernel 2.6. ... When I run "ps aux", ... size -A shad ... I'm trying to figure out where all this memory is getting eaten up!! ...
    (comp.os.linux.development.system)
  • Thank You -- Thomas J. Gritzan
    ... Thomas -- Your suggestion to malloc() out a block of memory was the ... Below are some details of my memory issues ... ... As a work around solution I guessed a ram disk would solve the ... persistence will frustrate the off topic police and give them a target ...
    (comp.lang.c)
  • Re: Simple question about headers and malloc!
    ... Therefore I am making all of its declarations ... memory (using malloc) and then exit back to main. ... allocation, I get data strored from the second allocation... ...
    (microsoft.public.vc.language)
  • Re: ten thousand small processes
    ... Stack needs to be executable for the current signal trampoline ... the use of malloc() that is causing your primary ... if there is any heap memory in use at all, no matter what you do, ... either directly, as a 4M page mapping (not used for user processes, ...
    (freebsd-performance)
  • Re: Review: My C FAQ Page
    ... the definition of memory leak is good but the information on ... this is not the most efficient way to allocate the 2-d array. ... You have ROW+1 calls to malloc. ... Allocate ROW pointers. ...
    (comp.lang.c)