Re: c++ code for display memory usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Alternatively, you could intercept malloc (and calloc, realloc, and perhaps
> valloc) and sum up all memory allocations on the heap, then call the real
> Standard C malloc.  That would give you "all memory ever allocated"
> footprint.
>
> If you also wanted to keep track of high water memory allocation, you'd have
> to intercept free and figure out how the heap stores the memory block's size
> (or record the block size yourself in your intercepted the malloc).

Alternately there are programs like VALGRIND or dmalloc which can help.

I suggest wikipedia "valgrind" and wikipedia "dmalloc"

Read those articles, they'll give you a better idea of what you're
asking, and what to ask for.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux