Thanks, that seems to give a likely sounding figure. Just to be sure, all new/delete/malloc/free in my program will contribute to that figure, right? I'm getting what I thought was a mem leak, since after a time calling new throws an exception, but it still seems to happen and the mem figure doesn't indicate a mem leak taking place... Is there any other reason that new would throw an exception? Perhaps heap fragmentation or something like that?
On 7/26/05, Christian Helmuth ch12@os.inf.tu-dresden.de wrote:
Hi,
On Tue, Jul 26, 2005 at 11:11:03AM +0200, Bert van Leeuwen wrote:
How can I check how much heap space is left (or used) in my drops/oskit program? Normally (in linux/gnu) I would use getrusage, which also returns a number of other useful statistics, but this function doesn't seem to exist in drops/oskit...
In "MODE = l4env" you could use one of:
#include <oskit/lmm.h>
extern lmm_t malloc_lmm;
unsigned int free_memory = lmm_avail(&malloc_lmm, 0); lmm_dump(&malloc_lmm); lmm_stats(&malloc_lmm);
-- Christian Helmuth
TU Dresden, Dept. of CS Operating Systems Group http://os.inf.tu-dresden.de/~ch12
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers