| Article: |
When Linux Runs Out of Memory | |
| Subject: | Re: Parsing /proc/meminfo before 'malloc'ing | |
| Date: | 2008-11-17 22:35:39 | |
| From: | dee_ | |
|
Response to: Re: Parsing /proc/meminfo before 'malloc'ing
|
||
|
Hi Mulyadi,
|
||
Showing messages 1 through 1 of 1.
-
Re: Parsing /proc/meminfo before 'malloc'ing
2008-12-05 20:12:08 santosam [View]



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.
regards,
Mulyadi.