[Xperia Play Android Development] Spizzy01:
Mods to increase free RAM/Testing Bay

AuroraPlayLE_Mod_-_Aggressive_Minfree_Values.zip - This will change the Minfree values of your device, enabling the killing of applications that are unused as early as possible, ensuring as much RAM is free as possible at all times.

1536,3072,4096,24576,32768,49152 > /sys/module/lowmemorykiller/parameters/minfree

Edit: The old ZIP unfortunately had a build.prop in it from the old AuroraPlay ROM... No idea how that got in there! If you flashed it, chances are you're apparently running AuroraPlay v1.1.0! Shouldn't be too much of a problem, however a quick reflash of the ROM would be recommended. The ZIP has been updated and the Build.prop removed. Sorry! :silly:

AuroraPlayLE_Mod_-_AuroraInitD__System_SwapON_Test.zip - This is in the VERY early stages of testing! - The main function of this MOD is to create and activate a swapfile on the SYSTEM partition to be used as a sort of 'RAM'.

This will NOT be included as default into the ROM at any time. The use of a swapfile on NAND or on your SDCard means almost constantly writing to either device - this will reduce the lifespan of your NAND or SDCard.

Currently, the ZIP will create a swapfile on your SDCard and activate it. It is not currently setup to create one on your NAND flash. Whilst this can just as easily be done, unfortunately it doesn't appear to be supported by our Kernel. (From looking on teh intarwebs)

You can successfully create and setup the swapfile on the SYSTEM or DATA partitions, however you cannot activate it. See below.

/system/xbin/busybox dd if=/dev/zero of=/system/swapfile bs=1M count=128
128+0 records in
128+0 records out
134217728 bytes (128.0MB) copied, 40.965912 seconds, 3.1MB/s
# mkswap /system/swapfile
mkswap /system/swapfile
Setting up swapspace version 1, size = 134213632 bytes
# swapon /system/swapfile
swapon /system/swapfile
swapon: /system/swapfile: Invalid argument

Invalid Argument: Basically translates to 'Not supported by your filesystem'.

For those who wish to have a 'Play' around with this, the actual contents of the Init.d script is as follows:

#!/system/bin/sh

# Memory Tweaks #

chmod 666 /proc/sys/vm/overcommit_memory
echo 1 > /proc/sys/vm/overcommit_memory
chmod 666 /proc/sys/vm/overcommit_ratio
echo 100 > /proc/sys/vm/overcommit_ratio

chmod 666 /proc/sys/vm/dirty_expire_centisecs
echo 200 > /proc/sys/vm/dirty_expire_centisecs
chmod 666 /proc/sys/vm/dirty_writeback_centisecs
echo 500 > /proc/sys/vm/dirty_writeback_centisecs

chmod 666 /proc/sys/vm/dirty_ratio
echo 10 > /proc/sys/vm/dirty_ratio
chmod 666 /proc/sys/vm/dirty_background_ratio
echo 3 > /proc/sys/vm/dirty_background_ratio

sync
chmod 666 /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches

# Enable SWAP #

#mount -ro remount,rw /system
#/system/xbin/busybox dd if=/dev/zero of=/system/swapfile bs=1M count=128
#chmod 666 /system/swapfile

#/system/xbin/busybox mkswap /system/swapfile
#/system/xbin/busybox swapon /system/swapfile

/system/xbin/busybox dd if=/dev/zero of=/sdcard/swapfile bs=1M count=128
chmod 666 /sdcard/swapfile

/system/xbin/busybox mkswap /sdcard/swapfile
/system/xbin/busybox swapon /sdcard/swapfile

echo 50 > /proc/sys/vm/swappiness

When I've finished testing I'll be setting the 'swappiness' to '100' which will basically mean that the system will only write to the swapfile, which is slower than RAM, in the event that the system runs out of free RAM. - This should keep the Play as responsive as possible at all times and also give us that little extra 'leap' when trying to run a heavy game.

Ah! Almost forgot to mention - There's another downside to having a swapfile on your SDCard... As soon as you connect your device to your computer, it'll unmount the SDCard which will remove the swapfile... Which is essentially the same as removing a stick of RAM from your computer whilst it is on. You shouldn't need me to tell you what would happen in the event such a thing happened, but simply put - You'll need to remove your battery and reboot your device because it'll crap out. :)

Note: I recommend either AdrenoBooster v0.6 or AdrenoBooster v0.2 for those who wish to benchmark.

Note 2: You can also delete the SEMCSetup.apk from /System/App after the first boot.​