Jump to content

Running android in ram?


Guest HMB

Recommended Posts

Hello! After installing android 2.2 (darkstone ram) on my brothers HTC HD2 and seeing the awesome speed and fluidity, I'm wondering why no one has done that yet? Sure you'll lose some ram but for me that is acceptable.

Kind regards /Henrik

Link to comment
Share on other sites

Guest gremlinman
Hello! After installing android 2.2 (darkstone ram) on my brothers HTC HD2 and seeing the awesome speed and fluidity, I'm wondering why no one has done that yet? Sure you'll lose some ram but for me that is acceptable.

Kind regards /Henrik

R u getting rom and ram confused? ?

Link to comment
Share on other sites

Looking at this, shouldn't it be possible to use a TPT to make the system-partition really small or nonexistent, the rest of the NAND for userdata/apps, and keep the ROM on the SD-Card?

Benefits:

+Lot of space for the user and his apps on the Nand... almost all space on NAND for the user and his apps, around 120MB more than with a normal TPT and a small system.

+This reduces need for A2SD. Nand is faster than the SD, so this is a plus.

+System gets loaded from the SD into the RAM at startup, and will be a lot faster than from NAND

-RAM gets reduced by the systems size, around 120MB, right? But around 300 MB available should still be enough!

-->Overall increased performance.

I guess we need some module that loads everything into the RAM at startup, I don't now if this would take two boots in a row (think like with HARET at WinMo).

But everything else should just work if this module works right, or not?

edit: Und danke für den Link, jurasstoil ;)

And thanks for the link, jurasstoil!

Edited by FelixL
Link to comment
Share on other sites

Guest fonix232

It wouldn't need a module, but a simple kernel addition (a little expansion to load the system into RAM, then just overwrite the place the system gets loaded).

Link to comment
Share on other sites

It could be a good idea for performance, but I'm really not sure. It might hurt performance more than it helps.

It wouldn't give any more usable storage space, because ram isn't permanent storage, it'd be lost on reboot or power off. So we'd still need to keep a copy in nand & load the entire partition into ram at boot, so it's going to add to boot time. It could possibly be stored on the sdcard, but it'd need to be in something else that's going to preserve file permissions, it can't just be on FAT.

Also, if we're loading stuff into ram disks then what about dalvik-cache? Would that give more of a performance boost & use less ram? That'd want to be rewritten to nand at power off though, which could cause problems.

The kernel already uses spare ram as a cache, so the benefits might not be so great. I'd expect the default kernel caching to do a better job.

Edited by wbaw
Link to comment
Share on other sites

It wouldn't give any more usable storage space, because ram isn't permanent storage, it'd be lost on reboot or power off. So we'd still need to keep a copy in nand & load the entire partition into ram at boot, so it's going to add to boot time. It could possibly be stored on the sdcard, but it'd need to be in something else that's going to preserve file permissions, it can't just be on FAT.

Is there much in /system that gets changed? I thought things like the settings get stored somewhere else, otherwise they would have had problems with this too on the build for the HD2 . If there are no changes while Android is running it would be no problem that the RAM isn't permanent. Only problem would be the need of a(ext2 or 3, I'd guess) partition for /system on the SD.

Also, if we're loading stuff into ram disks then what about dalvik-cache? Would that give more of a performance boost & use less ram? That'd want to be rewritten to nand at power off though, which could cause problems.

And what if the device has a spontaneous reboot...?

Edited by FelixL
Link to comment
Share on other sites

Data loss isn't a problem for the darkstone rom. On the HTC HD the Darkstone ROM/OS writes changes to a file located on the SD-card, this file should be possible to place on NAND on the Blade to avoid problems with unmouting/mounting memory card.

Here is a video that is pretty good at showing how fast the mobile becomes:

Kind regards /Henrik

Edited by HMB
Link to comment
Share on other sites

Guest vareBlade
Data loss isn't a problem for the darkstone rom. On the HTC HD the Darkstone ROM/OS writes changes to a file located on the SD-card, this file should be possible to place on NAND on the Blade to avoid problems with unmouting/mounting memory card.

Here is a video that is pretty good at showing how fast the mobile becomes:

Kind regards /Henrik

It took him 1 min to boot ( not sure if it matters that it was the 1st boot?)

Edited by vareBlade
Link to comment
Share on other sites

It took him 1 min to boot ( not sure if it matters that it was the 1st boot?)
First time takes A LOT longer, check the speed in the menus etc later on in the film :P

/Henrik

Link to comment
Share on other sites

Data loss isn't a problem for the darkstone rom. On the HTC HD the Darkstone ROM/OS writes changes to a file located on the SD-card, this file should be possible to place on NAND on the Blade to avoid problems with unmouting/mounting memory card.

When does it write these changes, while running or while shutting down? If while turning off, I guess you would loose all changes if the ROM crashes.

Link to comment
Share on other sites

Guest richardtkemp
When does it write these changes, while running or while shutting down? If while turning off, I guess you would loose all changes if the ROM crashes.

The data partition is stored on the sdcard as an img file, writes are made as needed. As far as I can tell data is not loaded to RAM. I would also love to see some development on this, as it seems not too complex (at least not so complex as some things) and the Blade has enough RAM to handle it.

Link to comment
Share on other sites

Guest kallt_kaffe
It wouldn't need a module, but a simple kernel addition (a little expansion to load the system into RAM, then just overwrite the place the system gets loaded).

I've got a version up and running now. Actually what I did was I overridden /init with a script that mounts the system nand partition to /system_nand and then copies everything into /system (which means it ends up in the ramdisk). When it is done it calls the real /init.

I've got two boot.img's for JJ ready (non-AHB and AHB overclocking).

Not sure if it's any faster. What we should take into consideration is that the HD2 guys usually run from a ext2 diskimage on the SD-card and what they changed is this ROM is that they copied the system.ext2 image into the ramdisk before mounting it. Going from SD-card to RAM will make a bigger difference than going from NAND to RAM as we will.

I'll have a link up in a minute with the two boot.img files.

Link to comment
Share on other sites

Guest kallt_kaffe

Here's two boot.img files for Japanese Jellyfish RLS9. Use them at your own risk.

It will have the "old" system mounted as /system_nand as read/write so you can easily make changes like adblocking, vm heap changes and stuff like that permanent by copying stuff from /system to /system_nand (assuming you know what you are doing).

http://www.mediafire.com/?24g3denn8fc2y2j

It's not very optimized, just a quick hack. Ideally we would use a much smaller busybox with just the minimum of needed commands in /bin.

USE FASTBOOT METHOD TO INSTALL!!

EDIT: Oh, and it will of course take a little longer to boot.

Edited by kallt_kaffe
Link to comment
Share on other sites

Guest kallt_kaffe
anyone try it yet? if so, how is the speed?

I have it running like that right now. Seems to work fine. Benchmarks in Quadrant and Linpack seems to be roughly the same. Feels a bit quicker but it might be placebo.

Link to comment
Share on other sites

Guest oh!dougal

Despite the thread title, surely it always runs IN ram? (Its not 'execute in place' is it?)

As far as can understand you have it running FROM ram (a /system ramdisk) rather than from nand.

And so its only any 'on the fly' loading of system modules that would be speeded up.

Does much of that go on (with our big ram)? And for what areas of the device's operation?

Link to comment
Share on other sites

Guest andycanada
I have it running like that right now. Seems to work fine. Benchmarks in Quadrant and Linpack seems to be roughly the same. Feels a bit quicker but it might be placebo.

So if I decide to try this, I need to first install JJ9, then use fastboot to flash the "boot.img" file to the boot partition?

i.e. "flashboot-mac flash boot boot.img"?

Link to comment
Share on other sites

Guest kallt_kaffe
So if I decide to try this, I need to first install JJ9, then use fastboot to flash the "boot.img" file to the boot partition?

i.e. "flashboot-mac flash boot boot.img"?

Correct!

Link to comment
Share on other sites

Guest kallt_kaffe
As far as can understand you have it running FROM ram (a /system ramdisk) rather than from nand.

Yes

And so its only any 'on the fly' loading of system modules that would be speeded up.

Does much of that go on (with our big ram)? And for what areas of the device's operation?

I'm sure some things will go quicker, but it'll cost ~120Mb RAM (with JJ) so is it worth it? Dunno? Installed apps, dalvik-cache, app-data are still on NAND.

However as I believe someone mentioned you could take this another step and put the entire system on the sd-card and load it into RAM at boot time and free up most of the NAND for data.

Link to comment
Share on other sites

Seems a bit OTT when there is cache in RAM anyway, some of the files loaded will not be used very frequently so loading everything into RAM would be wasteful. What might be better (if it's not already done) is firstly a large cache and secondly the ability to force certain files (like the framework) to be pre-loaded and always remain in cache (which they probably do anyway).

As pointed out earlier in the thread the WM guys are normally loading from SDcard which is already slower than NAND so the benefit they see is not likely to follow on the Blade which loads from NAND anyway.

Link to comment
Share on other sites

Guest kallt_kaffe
Seems a bit OTT when there is cache in RAM anyway, some of the files loaded will not be used very frequently so loading everything into RAM would be wasteful. What might be better (if it's not already done) is firstly a large cache and secondly the ability to force certain files (like the framework) to be pre-loaded and always remain in cache (which they probably do anyway).

As pointed out earlier in the thread the WM guys are normally loading from SDcard which is already slower than NAND so the benefit they see is not likely to follow on the Blade which loads from NAND anyway.

Yes, we propably loose more than we gain from this hack, unless we take it further and load the entire system from SD-card. We propably could also put /cache in RAM and get over 450Mb for /data. However I'm not willing to go that far, but a simple hack like not mounting /cache in init.rc would make it end up in RAM which would be much simpler than linking it into /data. Unless of course /cache contains stuff that need to survive a reboot?

Link to comment
Share on other sites

Yes, we propably loose more than we gain from this hack, unless we take it further and load the entire system from SD-card. We propably could also put /cache in RAM and get over 450Mb for /data. However I'm not willing to go that far, but a simple hack like not mounting /cache in init.rc would make it end up in RAM which would be much simpler than linking it into /data. Unless of course /cache contains stuff that need to survive a reboot?
Thank you for your work kallt_kaffe! I will try out the rom on wednesday. Do I lose clockwork recovery if I flash the modified boot.img?

Does anyone know how fast the NAND-memory on the phone is? I'm not convinced that it is faster than say a class10 SD-card.

Link to comment
Share on other sites

Guest zerosignull
Thank you for your work kallt_kaffe! I will try out the rom on wednesday. Do I lose clockwork recovery if I flash the modified boot.img?

Does anyone know how fast the NAND-memory on the phone is? I'm not convinced that it is faster than say a class10 SD-card.

its probably not.

The system will cache what it needs into RAM when used. As thee system does _not_ use any virtual memory you will only really see benefits in application start up.

edit: best benchmark I found after a quick search for internal disk speed is RL Benchmark SQLite Performance. Blade spanks the Legend, Tattoo and Galaxy S.

Edited by zerosignull
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.