linux - How to calculate "Max Contiguous Free Space" that is available in a process? -


in 64 bit linux-rhel62 machine, calculate "max contiguous free space" available in process. seems details may calculated using /proc/self/maps. not know how use file calculate contiguous free space.

any idea how ?

i have followed perl script given in linux: how check largest contiguous address range available process

but getting output "18446603339772190720" not acceptable value, (but understand somehow related 2^64). user not accepting value? correct , expected output? old code shows "physical memory + swap size" max contiguous free space. not convinced too, because getting same output every time.

please let me know, why getting such impossible memory size free space? show me light, how find max contiguous free space available?

that perl script looking at

/proc/<pid>/maps 

if @ end of process map on red hat you'll see this:

7fff105a1000-7fff105a2000 r-xp 00000000 00:00 0                          [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall] 

i able perl script give reasonable answer ignoring last entry, modified exit loop when address greater 0x800000000000

while (<$maps>) {         /([0-9a-f]+)-([0-9a-f]+)/;         last if hex ($1) > hex ( "800000000000" );         $max = hex ($1) - $end if $max < hex ($1) - $end;         $end = hex ($2); } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -