Re: How do I get heap and static memory information for /proc?

H. Peter Anvin (hpa@transmeta.com)
4 Nov 1999 00:01:14 GMT


Followup to: <3820B52C.B6C6DA90@tivoli.com>
By author: uabbasi <uabbasi@tivoli.com>
In newsgroup: linux.dev.kernel
>
> Hi,
>
> I am trying to figure out where I can dynamically figure out information
>
> about the Heap. The /proc/self/stat gives information
> about the stack like where the stack begins and the size (at least
> that's what it looks like). But I can't find out where to find that
> information about the heap (ie, where it begins and the size of the
> heap). I need similiar information about the static data
> area which I can hopefully glean from the /proc because I have to do it
> at run time.
>

Linux doesn't use conventional heap, although it does allow you to set
the brk(). Instead, malloc() usually uses mmap() to allocate
segments. This allows realloc() to use mremap() to move data areas
quickly if need be, and allows free() to free memory areas in the
middle of the address space.

-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/