When Linux Runs Out of Memory
Subject:   Re: Parsing /proc/meminfo before 'malloc'ing
Date:   2008-12-05 20:12:08
From:   santosam
Response to: Re: Parsing /proc/meminfo before 'malloc'ing

Hi Deepak

Sorry, I know no built-in glibc function that is able to do what you ask. Seems like you have to parse /proc/the-pid/maps by yourself and from there determine the largest VMA block you can allocate.

Pay attention that you could split the size you ask into smaller parts, since in real situation it's a bit hard to find big continous virtual memory area.

Sorry if it doesn't help you a lot and thanks for reading my article. Glad you find it useful.