View Single Post
Old 06-28-2010, 01:48 PM   #1
Mackx
Guru
Mackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to beholdMackx is a splendid one to behold
 
Posts: 999
Karma: 19985
Join Date: Dec 2008
Location: Netherlands
Device: iRex DR1000S
Available memory on DR

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.
Mackx is offline   Reply With Quote