Living with NVFS (updated) Guide to a Stable Handheld
When we first published "Living with NVFS" in July of 2005, NVFS was a new addition to PalmOS. We've since updated the article to reflect what we've learned in the interim and for changes made to the NVFS library found on new devices.
Technology never stops marching forward. When it changes, it often goes in directions we didn't predict. Today, we have more computing power on our wrists than a 60's era Apollo lander. Yet, where are the flying cars, ubiquitous video phones, and personal robots we were promised?
PalmOS continues to evolve in much the same way. After the unveiling of the much-ballyhooed PalmOS Cobalt in 2004, no such devices have come to market. Instead, we saw a resurgence of development in the older PalmOS Garnet; the "OS of choice"--it seems--of PalmOne (now Palm again) and other handheld manufacturers. The most significant upgrade to PalmOS Garnet was been the addition of the new non-volatile file system, a.k.a. "NVFS", found on all modern PalmOS devices.
Anyone who's had a PalmOS handheld for a few years knows the feeling: "Syncxiety"--the nervousness of carrying around un-synced critical data. Indeed, the susceptibility of these devices to data loss has long been their Achilles' heel, preventing their widespread acceptance amongst much of the general public.
NVFS addresses these problems by allowing data to be stored in non-volatile flash memory (or a hard drive) instead of normal RAM. Not only is flash memory largely immune to amnesia, but it is cheaper and requires less power than RAM chips, allowing handhelds to have greater storage capacity and longer battery life.
HOW IT WORKS
NVFS couldn't legitimately wear the badge of "system", however, if the situation were all that simple. Indeed, NVFS is impressively complex, for flash memory is far too sluggish to be used as normal operating memory. Instead, NVFS devices also have a standard (real) RAM memory area known as the "DBCache."
The DBCache provides 10 Megabytes of temporary storage for applications and data. When you launch an application or open a file, NVFS copies that file's data to the DBCache and copies it back only when you are done making changes. It even leaves the copy of the data in the cache to speed up future access, removing it only when more space is needed for new files.
Conceptually, NVFS is pretty simple, but some of the bugs are still being ironed out. Understanding how NVFS works can help when running software that hasn't been tweaked to workaround some of the quirks in the system.
The majority of problems occur when NVFS performs one particular maintenance operation. As mentioned above, NVFS tries to keep a copy of every file accessed (since the last soft reset). Thus, as you use your device, the DBCache starts to fill up with these file copies. When the DBCache gets to be about 9 Megabytes full, the system performs a "purge" operation, erasing files from the temporary RAM buffer to make more room for new files.
Problems sometimes occur when NVFS erases files or applications that are still in use. When this occurs, you may get some corruption, data loss, or even crashes. Most of this nastiness occurs due to applications that store or use data in unusual ways or have not properly "locked" their critical data to keep them from moving.
A second problem can occur with the opposite situation; applications that forget to "unlock" their data when they are done with it, causing the DBCache to fill up with locked blocks until the device eventually slows down and becomes unstable.
Often, however, you get crashes simply because early implementations of NVFS on the Tungsten T5 or Treo 650 weren't very smart about detecting whether an app or file was still "in use" and deleted apps indiscriminately unless they had been specially modified to prevent this. In all cases, working around the problem is possible but requires a fair amount of Holmesian sleuthing on the part of the user or developer.
If you own a Tungsten T5, Treo 650, or LifeDrive, the first step is to make sure you have the most up-to-date version of NVFS available. Early implementations under PalmOS 5.4.5 were the most unstable, while 5.4.9 is the most recent as of this writing. Almost any new T5 or Treo 650 needs to be updated. Check your version number under the Launcher's "Version" menu, then check the web site of your device manufacturer (or cell phone carrier) for any system updates that may be available. As of this writing, the Tungsten T5 1.1 Update is available at
If still you run into problems, the next step is to identify the offending program(s), and to replace or disable them as necessary. This is often not as simple as it seems. As problems mainly appear only after the DBCache is purged, you often get crashes when a large file operation causes the RAM buffer to fill up. This usually happens when running a backup program, file manager, movie player, or other application that accesses large blocks of data; NOT the application that is actually responsible. Thus, even when crashes consistenly occur within a particular program, that app is often entirely innocent of the crime.
Instead, crashes are usually due to a previously-installed background app that needs to be patched to work properly with NVFS. Look for hacks, drivers, or any program that can pop open a window or otherwise activate itself while you are inside another application. These background apps may even seem to work properly when you try them, only to stealthily cause crashes at a much later time when another app's data usage causes the DBCache to be purged.
To diagnose these problems, try using a tool like the "shuffle memory" feature in TealMover. This menu item forces the DBCache to purge all data at will, which will often cause active background applications to instantly crash if they need to be patched for NVFS compatibility. By selectively turning on and off suspect background apps and purging the cache, you should be able to methodically narrow down your list of suspects.
If you find a problem, check its developer for an updated copy of the program. In 2005, we released updated versions of TealMaster, TealLock, and TealScript with special NVFS-compatibility patches. As other developers are also generally aware of NVFS issues, most first-rate companies should have updated versions of their products available by now.
In newer versions of NVFS found on the Palm TX and newer devices, PalmOS is more aggressive about when it flushes applications out of RAM. In order for data to be considered "fixed" in the DBCache, not only does it have to be locked, but the file that contains it must be "protected" as well. This makes these devices much less likely to suffer from slowdown problems caused by accumulating locked data blocks. However, it also makes them more susceptible to the crashes caused by applications that haven't "protected" their files.
If you run into this latter problem, a few tools have hit the market that may help. RescoLocker allows you to manually lock applications in memory, and may help you fix buggy or older background apps and hacks that are causing crashes. A similar feature can be found inside TealBackup in the "Locked Applications" menu. When using either tool, simply lock any background applications, hacks, or drivers you suspect of being unstable, and see if crashes still occur.
If an application has locked its data but just hasn't set its file protect count, you can also use TealMover to protect the file. Open up the file in the TealMover "Info" screen and check its (confusingly named) "lock count". If it's zero, try setting it to one to see if that helps. Just remember to unlock all apps you have manually locked or protected before trying to delete or upgrade those apps.