Motorola Milestone - How to make the best of it - Part 2

Here we are with the Motorola Milestone again. In my previous post, I have tried to tweak the stock Froyo ROM for the Milestone in order to get the best performance that it can deliver.


So after the previous post, I had a Milestone with stock Froyo, rooted and overclocked. Also, the homescreen application was locked in memory so it wouldn't reload like crazy.





Everything was fine and dandy, but even though I overclocked the CPU, I was still a little unhappy with the overall speed of the system, and kept looking for improvements. And I found some more tweaks that made the phone a lot snappier and I actually managed to get 105MB or RAM free at some point.

The first thing I did was to install an app called Sysctl from the Market that tweaks some kernel parameters. The defaults work wonders, so I advise you don't meddle with them.
After installing Sysctl the system seemed much more responsive than before.

So the easter came, and of course I installed Angry Birds Seasons, which has grown a new easter episode. I didn't have any problems with any of the Angry Birds editions before, but this one managed to eat a lot of RAM, and once again, killed my homescreen. So I started to look for something that optimizes the RAM consumption, but I was unable to find anything. So I remembered that with the original Eclair ROM I managed to get 90MB of RAM free at some point, and so I started to check the differences between Eclair and Froyo. The two main features Froyo added were the Apps2SD that allows apps to be installed on the SD card and JIT(Just In Time) compiler. What JIT does is precompile some of the Java code, in native code, and so the apps run faster. The downside is that it eats more RAM. I never managed to get more than 80MB of RAM free on the Milestone with JIT enabled. So I thought I should disable JIT and see what happens. And guess what, once I disabled JIT I managed to get 105MB of RAM free. The 25MB increase worked like magic, and the Milestone was running smooth once again just like the old Eclair, but with even more free RAM than Eclair used to deliver. The Quadrant Standard benchmark scored a lower result than it did with JIT enabled, but in real life I didn't feel any speed difference. Angry Birds Seasons ran once again without killing the homescreen, and I also noticed that every app seem to start faster than before, and I guess that is because of more free RAM. In order to disable JIT you have to edit the build.prop file located in /system. The /system partition cannot be accessed directly from the OS, because the /system partition is read only. So what you need to do is copy that file to the SD card. The following command copies the file to the SD card(you need to go root first):



su
cp /system/build.prop /sdcard



After that, you have to connect your phone to the computer in "Memory card access" mode, so you can edit the file. I have found some more tweaks that can be applied to increase the performance. One is the VM Heap size which is 28m by default, and I switched it to 32m instead:

So you need to find the line that reads:


dalvik.vm.heapsize=28m



and change it to:


dalvik.vm.heapsize=32m



That should take care of the heap size which will make apps that require more memory run faster.

Next I have added the following lines at the bottom of the build.prop file:



dalvik.vm.execution-mode=int:fast
windowsmgr.max_events_per_sec=60



The first line disables JIT, and gives you more free RAM, while the second line makes the UI snappier. Make sure that you leave an empty line at the end of the file after these options.

After changing the file, save it and now we can replace the old file with the edited one. In order to do that you have to enter recovery mode. Turn your phone off, slide your keyboard open and press the X key. Now press the Power button while keeping the X key pressed. Wait until the phone enters recovery mode and the warning sign appears on your screen. After you entered recovery mode, press the volume up button and the camera key at the same time. You will be prompted with a menu. Select "Apply update.zip" from this menu. After the update.zip is applied you are prompted with the Open Recovery menu. Go to the "Console" option. Now you need to run the following commands so that you can replace the old build.prop file with the edited one. First we need to mount the /system partition in read/write mode:



mount -o remount,rw /dev/mtd/mtdblock4 /system



Now the /system partition is mounted in read/write mode. Now on to copy the edited file:


cp -f /sdcard/build.prop /system/



Now you can type exit to return to the Open Recovery menu. Now reboot your phone and you're done.

UPDATEI just found an app called A2SD GUI - Darktremor that seems to enable/disable JIT and also set the WM Heap size I have to say the the phone is so snappy now that I did not need to overclock it anymore, and so I have managed to squeeze more battery life out of it. However, I don't understand why Motorola did not add an option to enable/disable JIT, because for a device with low RAM such as the Milestone, the usability is greatly improved by disabling JIT.