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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -