Check out the new USENIX Web site. next up previous
Next: Store Structure Up: Automatic Persistent Memory Management Previous: The Operating System


Automation of Persistence

Most computing environments distinguish transient primary memory (RAM) and stable secondary memory, typically on hard disks. Because the latter normally has much slower access characteristics, programs operate in primary memory and persistence is achieved by copying to secondary memory and restoring from there.

PalmOS treats dynamic RAM as primary memory and static RAM as secondary memory. But on the Palm device the physical access speed of dynamic and static RAM are exactly the same! Only because PalmOS controls accesses to static RAM by certain exclusive access functions does it appear to behave like ``typical'' secondary memory.

By circumventing this control, though, and making more direct use of static RAM, we can eliminate the distinction between primary and secondary memory. Hence, no data has to be copied between the two areas when a program is suspended.

The Spotless VM was first modified to have a ``persistent heap,'' which is directly allocated in stable memory. The bytecode interpreter still uses dynamic memory, but all of the Java data (including bytecodes and threads) is allocated on the Java heap and thus in static memory. In order to be able to freely write to the heap, the VM uses the system call MemSemaphoreReserve, holding the semaphore during the normal interpretation of bytecodes and only releasing it when entering certain system calls that require it.

However, allocating the heap in ``static'' memory does not unburden the VM from having to shut down and resume as a Palm program, as discussed in section 3.2. Also, this ``in place execution'' inhibits the possibility of making a snapshot of a heap and then continuing execution without overwriting the snapshot data. We still chose this implementation because it greatly speeds up the shut down process as almost no data has to be copied to stable storage. Snapshots can still be achieved by stopping an application and then transferring the persistent store to a desktop system using the Palm device's serial port.




next up previous
Next: Store Structure Up: Automatic Persistent Memory Management Previous: The Operating System

2001-02-27