> space_used = marker_2 - marker_1; This won't work in DJGPP either. sbrk() allocates memory from wherever the system can find it - it doesn't always show up in contiguous blocks. Not that many DJGPP users care how much memory gdb is using.