Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex > iRex Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
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
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
Advert
Old 06-29-2010, 02:37 AM   #3
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
Thanks Iņigo,

I also found this, (linking away from the link that you send) which is also very helpfull.
Mackx is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Transferring from Main Memory to Memory Card Modern Bear Sony Reader 3 12-13-2009 06:40 AM
Books on internal memory show as on Memory Stick doreenjoy Sony Reader 6 06-05-2009 02:08 AM
memory card to main memory copy alexxxm Sony Reader Dev Corner 1 09-01-2008 11:04 AM
Suddenly files won't copy to flash memory-plenty of memory skoobwoman iRex 3 08-15-2008 02:52 PM
Moving files from memory card to main memory dhbailey Sony Reader 2 03-12-2007 11:43 AM


All times are GMT -4. The time now is 11:11 AM.


MobileRead.com is a privately owned, operated and funded community.