c - Logic behind finding Heap space available -
hi i'm new memory management, thought of finding logic find free heap space. feel finding difference between "program break" , "stack pointer" can correct? if not please justify , let me know right logic.
memory layout under linux complex beast , opinion should not care available heap: 1 of purpose of virtual memory. every process sees flat large memory space.
regarding propose solution, don't think correct because described here: http://duartes.org/gustavo/blog/post/anatomy-of-a-program-in-memory/ hep grows starting @ end of bss segment.
you can heap size process (22088 in example) terminal with:
cat /proc/22088/maps | grep heap 7f5082180000-7f5082ac7000 rw-p 00000000 00:00 0 [heap]
from c user space code, can read @ file heap size of current process.
Comments
Post a Comment