2010-08-23 08:49:24     Free Memory in the System

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-08-23 08:49:24     Free Memory in the System

Jayaprabhu Nadarajan (INDIA)

Message: 92692   

 

Hi,

 

Following is the Size Info of our Application.

 

   text    data     bss      dec     hex  filename

2070227  820569  12736656 15627452 ee74bc  APP

 

STEP 1:

-----------

Before Running our APP the free Memory in the system is

 

                     total         used         free       shared      buffers

  Mem:        60872        13412        47460            0           32

 

STEP 2:

-----------

If I run our App with a while(1) immediately after the main(), the free memory becomes

 

              total         used         free       shared      buffers

  Mem:        60872        43392        17480            0         2692

 

and after issuing "echo 3 >proc/sys/vm/drop_caches" it become

 

              total         used         free       shared      buffers

  Mem:        60872        35376        25496            0           48

 

I calculated the total memory utilized from /proc/<pid>/maps and it was 17884K. So my

expectation is the free should be (47460-17884)K=29576K but it is only 25496K. I am not sure what happened to the remaining 4M?

QuoteReplyEditDelete

 

 

2010-08-23 12:17:19     Re: Free Memory in the System

Mike Frysinger (UNITED STATES)

Message: 92697   

 

did you account for power-of-two allocations ?  if you allocate 3MiB, you will not get back 3MiB, you will get back 4MiB.

Attachments

    Outcomes