title: How to calculate "Max Contiguous Free Space" that is available in a process?
body: <p>In My <strong>64 bit linux-rhel62</strong> machine, i would like to calculate the "max contiguous free space" available in a process.
  Seems the details may be calculated using /proc/self/maps. But i Do not know how to use that file to calculate the contiguous free space. </p>
  
  <p>Any idea how to do this ? </p>
  
  <p>I have followed the perl script given in <a href="https://stackoverflow.com/questions/9403146/linux-how-to-check-the-largest-contiguous-address-range-available-to-a-process?rq=1">Linux: how to check the largest contiguous address range available to a process</a></p>
  
  <p>But i am getting output as "18446603339772190720" which is not a acceptable value, (But i understand this is somehow related to 2^64). But the user not accepting this value? is this correct and expected output?
  Some old code shows "Physical memory + swap size" as max contiguous free space. But i am not convinced with that too, because i am getting same output every time.</p>
  
  <p>Please let me know, why we are getting such a impossible memory size as free space?
  Show me some light, how to find max contiguous free space available? </p>