best way to discover this process's current memory usage, cross-platform?

MrJean1 MrJean1 at gmail.com
Thu Dec 1 18:58:36 EST 2005


Did you try the function I posted on Nov 15?  It returns the high water
mark, like sbrk(0) and works for RH Linux (which is dlmalloc, AFAIK).

/Jean Brouwers

PS) Here is that code again (for RH Linux only!)

size_t hiwm (void) {
    /*  info.arena - number of bytes allocated
     *  info.hblkhd - size of the mmap'ed space
     *  info.uordblks - number of bytes used (?)
     */
    struct mallinfo info = mallinfo();
    size_t s = (size_t) info.arena + (size_t) info.hblkhd;
    return (s);
}




More information about the Python-list mailing list