memory reported under linux higher that allocated?

Benoit Tremblay trembb22 at hotmail.com
Thu Feb 14 23:34:30 UTC 2008


My app start at 761k X 2 because a have an extra thread and my app is waiting to receive a command from another tcpip program that contrôle it. So I know when it start allocate memory to start doing what the app must do because a must send a command to start it.
 
I used ps -el | grep myapp to see the program size, the "top" utility reported 0%.
 
I just added 4 more gig to my AMD 6400 computer, so it's using 8gig of RAM now.
 
now, when I ran my app, after it allocated 3gig of RAM, "top" reported that my app used 40.5% of memory, it's suppose to be 37.5% so there is an extra 240 meg I dont know from where it come from.
 
ps -el reported that the parent thread is 809k in size and the child thread that do all the malloc is 828394k in size, It doesn't seem logic!
 
any idea.
 
----- when my app is currently allocating memory (see below)-----[trembb at cons15 ~]$ cat /proc/meminfo | moreMemTotal:      8168496 kBMemFree:       4319256 kBBuffers:         18132 kBCached:         344564 kBSwapCached:          0 kBActive:        3613836 kBInactive:       138524 kBSwapTotal:     2031608 kBSwapFree:      2031608 kBDirty:               0 kBWriteback:           0 kBAnonPages:     3389672 kBMapped:          29108 kBSlab:            32848 kBSReclaimable:    12200 kBSUnreclaim:      20648 kBPageTables:      14228 kBNFS_Unstable:        0 kBBounce:              0 kBCommitLimit:   6115856 kBCommitted_AS:  3532976 kBVmallocTotal: 34359738367 kBVmallocUsed:     41884 kBVmallocChunk: 34359693623 kBHugePages_Total:     0HugePages_Free:      0HugePages_Rsvd:      0Hugepagesize:     2048 kB
-----
----- When my app as terminated so no more memory is used (see below)-----
[trembb at cons15 ~]$ cat /proc/meminfo | moreMemTotal:      8168496 kBMemFree:       7635816 kBBuffers:         18152 kBCached:         344644 kBSwapCached:          0 kBActive:         303196 kBInactive:       138552 kBSwapTotal:     2031608 kBSwapFree:      2031608 kBDirty:               4 kBWriteback:           0 kBAnonPages:       79092 kBMapped:          27848 kBSlab:            32844 kBSReclaimable:    12200 kBSUnreclaim:      20644 kBPageTables:       7712 kBNFS_Unstable:        0 kBBounce:              0 kBCommitLimit:   6115856 kBCommitted_AS:   222308 kBVmallocTotal: 34359738367 kBVmallocUsed:     41884 kBVmallocChunk: 34359693623 kBHugePages_Total:     0HugePages_Free:      0HugePages_Rsvd:      0Hugepagesize:     2048 kB
-----
 
thanks for your help!
 
Benoit> Date: Thu, 14 Feb 2008 14:30:59 -0800> From: john.wendel at metnet.navy.mil> To: fedora-list at redhat.com> Subject: Re: memory reported under linux higher that allocated?> > Benoit Tremblay wrote:> > Hi,> > > > I have 4 gig of RAM and when I allocate 3 gig the <top> utilities show > > that my application is using 87% of the available RAM, so it's a half a > > gig more, why? The application is not doing any disk access.> > > > I just do a couple of malloc and the same amount of free at exit. I > > count all malloc by incrementing a "m" variable and I decrement the same > > "m" variable when doing free and at the program exit I display the value > > of "m" and it is zero. I stop doing malloc when my "m" variable reach 3 > > gigabytes so I am sure I allocate only 3 gigabytes so why my application > > is using 87% of all available RAM?> > > > Benoit> > > > What is the "available" RAM before your app starts? It is less than 4 > GB, since there is a lot of other stuff running in addition to your app.> > How much memory is you app using that isn't part of the malloc request?> > John> > -- > fedora-list mailing list> fedora-list at redhat.com> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
_________________________________________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20080214/7e97db73/attachment-0001.htm>


More information about the fedora-list mailing list