View Single Post
Old 06-28-2010, 04:48 PM   #2
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Quote:
Originally Posted by Mackx View Post
To protect xournal from memory overflows I try to determine how much memory is free at the moment that a file is opened in xournal. I am using the output of the /proc/meminfo, but it is confusing me. I browsed some time on the internet, and I could only find what the individual field mean, but not how to determine the actual amount of free memory.
The output looks like this (on the emulator):
Code:
MemTotal:       126796 kB
MemFree:         71936 kB
Buffers:          1508 kB
Cached:          29148 kB
SwapCached:          0 kB
Active:          33464 kB
Inactive:        15316 kB
SwapTotal:           0 kB
SwapFree:            0 kB
Dirty:             528 kB
Writeback:           0 kB
AnonPages:       18152 kB
Mapped:          11740 kB
Slab:             3408 kB
SReclaimable:     1452 kB
SUnreclaim:       1956 kB
PageTables:        680 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:     63396 kB
Committed_AS:    35876 kB
VmallocTotal:   253952 kB
VmallocUsed:      4596 kB
VmallocChunk:   241660 kB
I know that linux is 'lazy' in releasing memory, so I need to know the free memory and that part that is ready to be freed. The description of Active: and Inactive: tells that it is memory that is ready to be freed. But it sums up to about 120MB which would mean that only 8MB is used after the DR is started.
I think that I make a mistake, but where did I make it?

Thanks,
Marcel.
The free memory should be = MemFree + Buffers + Cached.

To recover some of the memory in caches and buffers look at the trick in http://www.timesys.com/blogs/joseph/freememory
Iņigo is offline   Reply With Quote