| Article: |
When Linux Runs Out of Memory | |
| Subject: | Re: Parsing /proc/meminfo before 'malloc'ing | |
| Date: | 2007-03-24 10:36:40 | |
| From: | mulyadi_santosa | |
|
Response to: Parsing /proc/meminfo before 'malloc'ing
|
||
|
Hi Unna..
|
||
Showing messages 1 through 2 of 2.
-
Re: Parsing /proc/meminfo before 'malloc'ing
2008-11-17 22:35:39 dee_ [View]
-
Re: Parsing /proc/meminfo before 'malloc'ing
2008-12-05 20:12:08 santosam [View]
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.
regards,
Mulyadi.



Hi Mulyadi,
Thanks for this great article. It is really helpful.
I am facing one problem. I want that my application should be able to find two things:
1) available heap memory
2) largest block of heap memory that it can allocate.
Calculating available free pages and available user space will help me how?
Can you help me in this?
Regards,
Deepak