Women in Technology

Hear us Roar



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..


Sorry for this late reply. I am also confused why it can actually report there was still 60 MB of free memory after you do malloc()+memset() the first 32 MB block. The things I can suggest are:
1. Please make sure you get a valid memory report. There is a chance you are reading not-up-to-date information (kinda delayed).


2. Find out more about your OS. Is it Linux? BSD? else? Pay attention for things like how they actually do memory allocation. I also forgot to tell the reader one thing (more because I haven't done closer research about it), kernel actually reserves some amount of RAM for special purpose. I don't know the exact amount, so you probably hit this "unseen" area.


Feel free to reply on this thread... and anyone may CMIIW.


regards,


Mulyadi

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Re: Parsing /proc/meminfo before 'malloc'ing
    2008-11-17 22:35:39  dee_ [View]


    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