192 megs of ram?!

Search This thread

mystica555

Senior Member
Feb 3, 2009
52
4
Hello,

I apologize if this has been covered... It seems that our forum is unable to search for 3 character terms, specifically "192" and "ram".

The G1 is listed as having 192 megs of memory. Yet, running "free" from my rooted RC33(JF1.41) shows:
Code:
$ su
# free
              total         used         free       shared      buffers
  Mem:        99040        96292         2748            0          316
 Swap:            0            0            0
Total:        99040        96292         2748
#


So, where's my other 96 megs?! If -all- this extra ram is being used for 3d (god forbid) I'd gladly tweak a setting to reclaim more ram for RUNNING APPS, versus bling bling.

Anyone have any ideas here?
 

LucidREM

Senior Member
Jan 18, 2009
1,571
5
Baltimore
www.lucidrem.us
Hello,

I apologize if this has been covered... It seems that our forum is unable to search for 3 character terms, specifically "192" and "ram".

The G1 is listed as having 192 megs of memory. Yet, running "free" from my rooted RC33(JF1.41) shows:
Code:
$ su
# free
              total         used         free       shared      buffers
  Mem:        99040        96292         2748            0          316
 Swap:            0            0            0
Total:        99040        96292         2748
#


So, where's my other 96 megs?! If -all- this extra ram is being used for 3d (god forbid) I'd gladly tweak a setting to reclaim more ram for RUNNING APPS, versus bling bling.

Anyone have any ideas here?

http://xdaforums.com/showthread.php?p=3262422
 

mystica555

Senior Member
Feb 3, 2009
52
4
Code:
$ su
# free
              total         used         free       shared      buffers
  Mem:        99040        96292         2748            0          316
 Swap:            0            0            0
Total:        99040        96292         2748
#
And ofcourse I end up reading the reply to my post -after- i write this one. Edited as I'm an idiot. :)

It still seems to me that 192 megs is A; misleading and B; clearly NOT enough to run this OS, along with radio "firmware" (why cant the radio have its own bloody discrete chip!?)

I presume this huge gaping usage of ram is why the Sprint Touch Pro shows 288 megs of ram; its really 384 with the rest being used by the phone's radio and framebuffer. Gah.

I wonder, will new Android hardware overcome this paltry 96 meg limit?
 
Last edited:

LucidREM

Senior Member
Jan 18, 2009
1,571
5
Baltimore
www.lucidrem.us
And ofcourse I end up reading the reply to my post -after- i write this one. Edited as I'm an idiot. :)

It still seems to me that 192 megs is A; misleading and B; clearly NOT enough to run this OS, along with radio "firmware" (why cant the radio have its own bloody discrete chip!?)

I presume this huge gaping usage of ram is why the Sprint Touch Pro shows 288 megs of ram; its really 384 with the rest being used by the phone's radio and framebuffer. Gah.

I wonder, will new Android hardware overcome this paltry 96 meg limit?

indeed .. but that would be why rooting the G1 is so nice .. move files over to a linux EXT2 partition on the SD card and viola!! ultimate space

i have 1.5G dedicated to the G1 .. keeps the phone free and clear
 

mystica555

Senior Member
Feb 3, 2009
52
4
Flash is not SDRAM

indeed .. but that would be why rooting the G1 is so nice .. move files over to a linux EXT2 partition on the SD card and viola!! ultimate space

i have 1.5G dedicated to the G1 .. keeps the phone free and clear

I could care less about the total amount of installed apps; I've got plenty of free yaffs2 flash for what I end up running...I simply don't want my apps to get oom-killed.

I simply wish to run, ALL CONCURRENTLY, (cpu speed be damned!)
Connectbot
HelloAIM!
PicPush
StreamFurious or Last.fm
Gmail
AND the browser
without one or more (or the home screen) forcibly being killed due to out of memory errors.

Load Browser, 2 or 3 of those always end up dying.

A normal commute for me on the bus: I'm chatting on AIM. I've got a irssi session open on my VPS in Connectbot. Last.fm playing some futurepop. I tap the notification bar to read the new email I have, which contains an HTML link. Click the link...Boom, music stops playing. Close browser, homescreen reloads slowly. Go back to connectbot, well, im disconnected.

RAM = Godly.
 

mystica555

Senior Member
Feb 3, 2009
52
4
Let's try this...

Code:
# cd /sdcard
# dd if=/dev/zero of=swap.fil bs=1M count=128
128+0 records in
128+0 records out
# mkswap ./swap.fil
Setting up swapspace version 1, size = 134213632 bytes
# swapon ./swap.fil
# free
              total         used         free       shared      buffers
  Mem:        99040        97112         1928            0          556
Swap:       131064            0       131064
Total:       230104        97112       132992
#
 

andonnguyen

Senior Member
Nov 12, 2008
842
3
Code:
# cd /sdcard
# dd if=/dev/zero of=swap.fil bs=1M count=128
128+0 records in
128+0 records out
# mkswap ./swap.fil
Setting up swapspace version 1, size = 134213632 bytes
# swapon ./swap.fil
# free
              total         used         free       shared      buffers
  Mem:        99040        97112         1928            0          556
Swap:       131064            0       131064
Total:       230104        97112       132992
#

What does that do? Does it create a swap file on the sd card?
 

LucidREM

Senior Member
Jan 18, 2009
1,571
5
Baltimore
www.lucidrem.us
Code:
# cd /sdcard
# dd if=/dev/zero of=swap.fil bs=1M count=128
128+0 records in
128+0 records out
# mkswap ./swap.fil
Setting up swapspace version 1, size = 134213632 bytes
# swapon ./swap.fil
# free
              total         used         free       shared      buffers
  Mem:        99040        97112         1928            0          556
Swap:       131064            0       131064
Total:       230104        97112       132992
#

i'm slightly hesitant to try .. anyone? good / bad / indifferent???
 

t1n0m3n

Senior Member
Jan 27, 2009
507
64
Chicago
yeah a reboot will cancel... how can I make this permanent? What file can I put the swapon command into? I just tried init.rc, but that didn't work.
 

mystica555

Senior Member
Feb 3, 2009
52
4
PROOF OF CONCEPT ONLY! Serious risks involved, still working on this!

As a test, it works. however:

This has a few(lot of?) problems! :)

Biggest: your sd card cant be mounted as a disk unless you stop swapping. or reboot.

Next: your sd card will die sooner rather than later, as you are doing what it never was intended to do (writing moving data back and forth when its really good just for storing files that may change. sometime.)

Finally, things can start to run slow...VERY slow...
Biggest issue, after my busride with last.fm never stopping, browsing, all the stuff that kept making me angry before. Then i got home and tried to make a phonecall... The dialer worked *reasonably* responsive.. All of about 10s to bring it up. However, MAKING the call took...an eternity.

Hit the green button to dial...phone starts ringing, friend answers, we start talking.. I look at the phone.. black screen...ITS WAITING FOR THE ANDROID PIC AND CALL TIMER THING TO COME UP...40s after i started the call, got a message saying that one process was not responding, force or wait. at this point, when *that* dialog came out of swap, lo and behold the process actually not responding was working fine behind said dialog...

So yeah. its got its benefits, but very large downfalls.

As you *WILL* destroy your flash after an unspecified amount of time, *do not* try to put this on your internal flash. Not in /cache for example. Flash cards are cheap; replacing the g1 because you nuked 64 megs of flash ram is not...

I will test a few methods of separating the flash card from the vfat filesystem (mountable via usb_mass_storage) and report back. Probably partitioning the card, one as swap and such.

ON the other hand, I may also try partitioning 128m as fat16, to make certain the small card's wear levelling scheme is able to do whatever it can to help mitigate the destruction-by-swapping.

Fat32 may not have the same wear levelling mechanisms at the card level on anything less than an SDHC, and guaranteed ext2 wont. Raw swap won't either... As far as I remember, flash wear levelling on sdcards is based entirely on how FAT allocates blocks. (someone knowledgeable about the SD/SDHC and wear levelling feel free to chime in!)

I'll post more later when I try a few more things!
 
Last edited:

t1n0m3n

Senior Member
Jan 27, 2009
507
64
Chicago
As a test, it works. however:

This has a few(lot of?) problems! :)

Biggest: your sd card cant be mounted as a disk unless you stop swapping. or reboot.

Which is why I put it in /system/sd/swap/swap.fil

Next: your sd card will die sooner rather than later, as you are doing what it never was intended to do (writing moving data back and forth when its really good just for storing files that may change. sometime.)

Not an issue for me. By the time it wears out, I will have upgraded to a newer faster card anyway.

Finally, things can start to run slow...VERY slow...
Biggest issue, after my busride with last.fm never stopping, browsing, all the stuff that kept making me angry before. Then i got home and tried to make a phonecall... The dialer worked *reasonably* responsive.. All of about 10s to bring it up. However, MAKING the call took...an eternity.

Hit the green button to dial...phone starts ringing, friend answers, we start talking.. I look at the phone.. black screen...ITS WAITING FOR THE ANDROID PIC AND CALL TIMER THING TO COME UP...40s after i started the call, got a message saying that one process was not responding, force or wait. at this point, when *that* dialog came out of swap, lo and behold the process actually not responding was working fine behind said dialog...

So yeah. its got its benefits, but very large downfalls.

Could this be due to the speed of your SD card? I am already noticing a marked performance increase.
 

t1n0m3n

Senior Member
Jan 27, 2009
507
64
Chicago
I tell you what, if you can give me an idea of where to make this permanent, I am willing to run this card to destruction. I have another 8G class 6 card ready to go, and can swap out easily at any time. All I have to do is make regular backups on my laptop and I should be good to go. (And even then data loss is not really an issue for me anyway.)
 

mystica555

Senior Member
Feb 3, 2009
52
4
Wear levelling..Different than I thought.

ON the other hand, I may also try partitioning 128m as fat16, to make certain the small card's wear levelling scheme is able to do whatever it can to help mitigate the destruction-by-swapping.

Fat32 may not have the same wear levelling mechanisms at the card level on anything less than an SDHC, and guaranteed ext2 wont. Raw swap won't either... As far as I remember, flash wear levelling on sdcards is based entirely on how FAT allocates blocks. (someone knowledgeable about the SD/SDHC and wear levelling feel free to chime in!)

Ok, I read a bit into this myself and it seems even back in 2003 wear leveling is done at a very low level: CHS/LBA blocks, versus FAT Blocks.
Sandisk Whitepaper from 2003
I would expect that this sort of wear-leveling is in effect on any of their current cards, including the microsdhc the G1 came with.

As such, it seems swap/ext2 won't have much if any difference compared to FAT filesystems. Its recommended to mount the ext2 with option "noatime" however, so that metadata won't be written for -every single read-.
 

mystica555

Senior Member
Feb 3, 2009
52
4
Which is why I put it in /system/sd/swap/swap.fil
It seems I haven't read enough about where you can put files.. Is this /system/sd normal for a G1, or is this after you went and moved apps/caches to the SD card?

Not an issue for me. By the time it wears out, I will have upgraded to a newer faster card anyway.
Indeed! This is mainly a warning to not try and use the phone's internal flash.

Could this be due to the speed of your SD card? I am already noticing a marked performance increase.
I am 90% certain that it is the speed of the card. Note: I am still using the 1gb card that was installed initially, sadly this phone broke me. Payday friday though means a trip to microcenter ;)

That, or you haven't run 64 megs of apps out of main ram into swap. I had a -lot- of junk running in the background, in addition to the laundry list of apps enumerated earlier in the thread. I think it was: connectbot, helloaim, browser with 4 windows, terminal, alarmclock, calendar (twice! wtf) tmo myfaves switcher, last.fm, maps, voice dialer (twice as well?) google talk messaging klaxon and about 2 or 3 others I cant remember. At peak usage, I had 68 megs swap used and all the ram used as well.

There should be a rather quick and dirty way of getting this into an init script. I'll mess with it at lunch tomorrow.

Right now, sleep is calling and this is one call I'm not forwarding to voicemail! :D
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    while swap does hurt the performance of any modern OS, it hurts less than not having it. what is important is tuning one's swap to the constraints of the wired backend ram and swap.
    if you do not have swap, you force linux to flush its file caches and buffers in favor of program memory (that may or may not actively be in use) this is just as painful as pulling from swap, because it is the difference between pulling a file from ram instead of off the filesystem.
    anyone who says NO SWAP, or NO SWAP IN EMBEDDED STUFFS clearly has no understanding of modern VMM's. you cripple them running them without swap. you severely limit the tuning that years of coding have gone into.
    of course, the inverse is also true when you're talking about a slow device. the idea is to only swap what is unused, and allow the OS to still keep adequate buffers. keep your swap small, and tune your swappiness so that it only swaps pages of ram to disk under the direst of circumstances. the goal is not to fool the OS into thinking that it has more ram than it does, it is to get the OS to use it more intelligently (and not kill our precious processes). unfortunately, the guys at google did not do this for us, and so it is up to us.
    1
    You guys are seriously joking with this argument about 'swappiness' right? I mean there are actually children dying of hunger in the world. I mean really, I do not know much about linux or pc's but an argument about virtual ram in physical reality, seriously? Cant everyone just get a long.

    Not to sound like a d*ck, but did you really have to bring such an old post back to life to say that? You could have shared your thoughts, perhaps in the general section and actually get some positive responses....
    I'm just saying =P
    In any case, I completely agree with you. It's quite foolish of *us* to argue over such things when there are more important, real things going on in the world..