![]() |
![]() |
![]() |
Pilot in FragmentsWhen installing a new application on my Pilot, I'd often get a message from HotSync telling me that I couldn't install because of insufficient memory. If I then used the Memory application to check how much memory was free, I'd usually see anywhere between 20K and 80K free, and given that most Pilot applications are in the same approximate size range, I wouldn't give it a second thought. But after installing the SuperPilot 3 Mb RAM card mentioned in last month's column, I found myself getting the same message when I had over a megabyte free. My first suspicion was that perhaps the Pilot ROM only permits applications to load in the first two megabytes of RAM, but I hadn't heard anything to that effect before. Checking on the TRG web site (http://www.trgnet.com ) turned up a discussion about memory fragmentation, and an application called DeFragger to fix it. One version is free, and only works with a SuperPilot board; the other will work on any Pilot, but has a $15.95 price. On a Pilot, memory is physically divided into 64K heaps, with a maximum of up to 16 Mb on a memory card. The OS allocates memory as chunks which are any size up to the max storable in a heap, which is 64K. Chunks can then potentially be moved around between heaps to make the best fit; this process is called defragmenting. The OS tends to allocate chunks evenly across heaps, meaning that the maximum sized chunks available can end up being quite small; possibly too small to load in a moderate sized application, even though enough space in total is free to fit it in. DeFragger collects up different sized chunks to try to fill up heaps, so as to end up with as many completely empty heaps as possible, and so maximise the usable free space. | ||
DeFragger Heap Graph for a tidy Pilot |
![]() | |
| ||
just loaded a 56K app |
![]() | |
| ||
after defragging |
![]() | |
Installing and running DeFragger showed that I only had 2 Mb of data in my 3 Mb Pilot, but that was evenly spread out through the memory map. It presents the information as a column graph of the heap, although there are several more options to get more detailed breakdowns of memory usage in both RAM and ROM (or flash RAM, if you have the right sort of card). Running the Defrag->Normal menu option in DeFragger soon cured the fragmentation, although soon is a relative term: with a badly fragmented Pilot the program took several minutes to complete. Monitoring the situation since then, I find that it's a good idea to run the defragmenter every couple of weeks. |
||
Words and design by: |