The Deliverator – Wannabee

So open minded, my thoughts fell out…

Trimming Jornada’s Memory Footprint

Posted by Deliverator on July 27th, 2005

In my experience with my J720 ( which only has 32 MB of ram – split between being used for application storage and execution), almost all applications are happy to run from compact flash. Although many need to be installed to ram to begin with, most can be moved/migrated over to flash afterwards with little or no tweaking. I have managed to get my allocated ram storage down to a little over 4 MB, so even leaving a little wiggle room, I have 25+ MB of ram for running programs. With that much ram free, why do I care? Firstly, I do a lot of multitasking and secondly, it looks like Minimo will take up 20+ MB if it ever gets backported to HPC. I was looking at ways of shaving off a bit more space and have hit a few barriers:

– Background images takes up ~450 KB, due to support for only bmp format.
– Applications that you want to automatically start after a soft reset need to be located in ram. If you try to use shortcuts pointing to CF, inconsistent results will occur, as it tends to take a few seconds after a soft reset for the CF to be initialized/mounted. Thus, sometimes the shortcut will be run before the target it is pointing at is available to the system.

I tried addressing the first problem by using a poorly documented/translated japanese program called SQ. This program does let you use jpeg images (if you install the right program plugin and can extract the stupid lzh archive) for backgrounds, but only if you use their desktop/shell replacement mode. You can switch back and forth between the SQ desktop/shell and the original one very easily, but the jpeg image will only appear on the SQ desktop. There are enough deficiencies in the SQ desktop/shell that it pains me to use it just to get jpeg background support.

The second problem could be addressed with a simple application launcher program, but I haven’t found one that does what I want. The application launcher would be a small stub of an executable (no more than 5-10 KB) whose sole function would be to wait 5 or so seconds after it is launched, execute a list of programs (located on CF) and then terminate itself. This is such a simple program, yet it would help me free up at least another 500 KB. I could easily write it, but it would mean going through the whole process of setting up a build environment. I wonder if HPC batch files could be used for the same purpose?

Another approach might be to create a compressed, self extracting executable and leave the result in ram. There would be some overhead by including the extractor code in each and every program, which would hopefully be much smaller than the ammount by which the executable could be compressed. I have tried zipping a number of exe files, just to get a rough idea of to what extent they could be compressed and the results look good, at least for larger executable (probably not worth it for smaller ones, due to overhead). This would be a much bigger coding project than the previously mentioned solution, but would have the benefit of working on applications that can only run from main system ram. There is also the downside that the CPU would be hit pretty heavily during initial decompression, resulting in a slower system startup.