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@cons15 ~]$ cat /proc/meminfo | more MemTotal: 8168496 kB MemFree: 4319256 kB Buffers: 18132 kB Cached: 344564 kB SwapCached: 0 kB Active: 3613836 kB Inactive: 138524 kB SwapTotal: 2031608 kB SwapFree: 2031608 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 3389672 kB Mapped: 29108 kB Slab: 32848 kB SReclaimable: 12200 kB SUnreclaim: 20648 kB PageTables: 14228 kB NFS_Unstable: 0 kB Bounce: 0 kB CommitLimit: 6115856 kB Committed_AS: 3532976 kB VmallocTotal: 34359738367 kB VmallocUsed: 41884 kB VmallocChunk: 34359693623 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 Hugepagesize: 2048 kB
-----
----- When my app as terminated so no more memory is used (see below)-----
[trembb@cons15 ~]$ cat /proc/meminfo | more MemTotal: 8168496 kB MemFree: 7635816 kB Buffers: 18152 kB Cached: 344644 kB SwapCached: 0 kB Active: 303196 kB Inactive: 138552 kB SwapTotal: 2031608 kB SwapFree: 2031608 kB Dirty: 4 kB Writeback: 0 kB AnonPages: 79092 kB Mapped: 27848 kB Slab: 32844 kB SReclaimable: 12200 kB SUnreclaim: 20644 kB PageTables: 7712 kB NFS_Unstable: 0 kB Bounce: 0 kB CommitLimit: 6115856 kB Committed_AS: 222308 kB VmallocTotal: 34359738367 kB VmallocUsed: 41884 kB VmallocChunk: 34359693623 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 Hugepagesize: 2048 kB
-----
thanks for your help!
Benoit
> Date: Thu, 14 Feb 2008 14:30:59 -0800 > From: john.wendel@xxxxxxxxxxxxxxx > To: fedora-list@xxxxxxxxxx > 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@xxxxxxxxxx > To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
|
--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list