TealPoint Logo



SEARCH
  
TECH ARTICLES

    The Palm Foleo - Thoughts for the Future
    Living with NVFS (updated)
    Crashes, Errors and PalmOS
    PalmSource Post Report
    What's That I Hear?
    Palms, ARMs, and Handhelds
    The Future of PalmOS
    Movies on the Move
    Hacks on your Handheld
    PalmOS Version-o-Rama
  Memory and the Modern Palm
    New PalmOS handhelds hit market
Help
      Am I Compatible?
      How to Purchase
      How to Install
      Get Support
      Tech Articles
      Contact Us
      Site Map

Company
    
Our Company...

      Press
      About Us
      Newsletter
      Online Store
    
Resources...

      Ad Banners
      PalmOS Links

HomeSoftwareAdd-InsGuidesCommunityPress

PalmOS Tech Articles > #2,

Memory and the Modern Palm
All About Palm Memory

Got memory? Memory is probably the most important single resource on your Palm OS(R) organizer. Understanding memory and how a Palm uses it can help you get the most out of your handheld. To help, we've put together this overview of memory technologies, following with an explanation of how they're each used in Palm organizers, and finishing with tips on how you can accordingly best use these different types of memory.

MEMORY TECHNOLOGIES

RAM (Random Access Memory)

RAM. Even the most dyed in the wool technophobe would sheepishly admit to knowing that RAM is an acronym for Random Access Memory. On a Palm handheld, RAM makes up the bulk of storage memory, and is used both for the storage of files and temporary working space for applications. Typically, when people refer to a device's "memory" -- as in "Your 2 Megs of memory is puny compared to my manly 8 Megabytes" -- they're only talking about its RAM memory. Data stored in RAM can be quickly viewed (read) or changed (written) by a program's code, but RAM needs a constant source of power to keep any data stored from disappearing.

ROM (Read Only Memory)

ROM memory, unlike RAM, contains data that cannot be changed or erased, even by turning off the power. Instead, its data is determined at manufacture and is etched onto the chips themselves. ROM chips were used to store the operating system software in early PalmPilots, and continues to be used in current Handspring organizers in the same capacity. ROM chips' benefits include low cost and durability. Their primary shortcoming, however, comes in upgrade ability. Data in ROM can only be updated by replacing the entire chip, and this is often impractical.

FLASH ROM

Addressing the primary limitation of ordinary ROM memory, flash memory contains data that can be updated when necessary. The update process is very slow by computer standards (and yet it's oddly called flash!), taking a few seconds or minutes to update a file, and contents can only be changed a few thousand times before the chips wear out and start to get amnesia. Still, flash memory does not require power to keep its contents intact, and thus is commonly used as a ROM that can be periodically updated when necessary.

ON THE PALM

Memory usage on the Palm falls into four broad descriptive categories: operating system storage, program and file storage, program working space, and removable media.

OPERATING SYSTEM STORAGE

An operating system acts as a digital middleman between programs and the device hardware, providing common services like file handling and a standard graphical user interface. In the original Pilot and PalmPilot organizers, the Palm Operating System (Palm OS) was stored in a 1 Megabyte ROM chip. Later, when the Palm III debuted, it came with OS version 3.0 filling 1.2 Megabytes of a 2 Megabyte flash ROM. The seemingly small addition of flash has allowed Palm III models to keep up with the times. In the last few years, Palm OS has been steadily upgraded to versions 3.1, 3.3, and 3.5, adding support for better communications, networking and display modes.

The flash ROMs also contained 800k of unused flash memory--space that could be turned into usable storage for programs and data by enterprising companies like TRG (now HandEra), who made programs to move files from RAM into the spare flash. Unfortunately, when Palm OS grew to version 3.5, its larger size left only 300k of extra storage space. The good news is that Palm's new m500 and m505 organizers now ship with OS 4.0 occupying only 2.3 Megabytes of new larger 4 Megabyte flash ROMs, leaving a nearly two Megabytes "free" additional storage in those units.

PROGRAM AND FILE STORAGE

A common misconception about Palm memory is that an 8-Megabyte Palm is roughly equivalent to a PC with 8 Megabytes of RAM, which, while firmly in the "puny" category today, was fairly common only a few years ago. The difference, however, is that a Palm organizer does not have a hard drive on which to store files that are not currently in use. To make up for this, the majority of RAM on a Palm is actually reserved for use as a "virtual hard drive" to store files and data. Only a very small amount of RAM is actually left for currently active program to be used as ordinary RAM.

The file storage area of memory is called the "storage heap". The storage heap is electronically safeguarded from unintended modification by misbehaving apps, giving robustness required of a hard-drive replacement. Unlike a hard drive, however, data in the Palm OS storage heap can still be directly accessed (read) by applications and the Palm's microprocessor. This is why Palm apps rarely have manual "load" and "save" commands; files can often be used while they're still on the storage heap. This also eliminates the wasteful delays, extra memory overhead, and risk of loss data encountered under less evolved operating systems like Pocket PC. In that OS, data stored in file memory must first be copied to precious working memory before it can be used, and later copied back to permanently save any changes.

PROGRAM WORKING SPACE

The small amount of working RAM allocated to running programs is known as the "dynamic heap". The size of the dynamic heap varies with OS version and total available RAM. In Palm OS 2.0 and earlier, it was fixed at 64k. This amount was increased in OS 3.0 to 96k, but was changed in OS 3.5 to be variable, ranging from 64k to 256k, depending the total amount of RAM on the device.

The dynamic heap size is important, because it limits how much an individual program can do. Games and other graphics or data-intensive apps tend to use a lot of dynamic memory, so the complexity and size of the graphics often depends on how much is available to the program. You might encounter this limit, say, in a paint program whose drawing buffers are stored on the dynamic heap. The size of the image you are working with may only grow so large before you run into the memory limit. You can't delete programs to make more space in this instance, because that would only free up space on the storage heap, not the dynamic heap.

The situation gets more complex when you consider the new higher-resolution Palm OS devices or add-on system extensions, commonly called "hacks". The new HandEra 330 and color Sony Clie handhelds feature higher resolution screens than previous models. Supporting these screens require larger video buffers and graphic bitmaps, all of which use more memory from the dynamic heap. This means that programs which push the limits on standard Palms may not run in higher-resolution simply because they run out of dynamic memory.

A similar problem occurs while running system extensions, commonly called Hackmaster apps, or "hacks". While Palm OS was not designed to support multitasking of applications, these add-on programs provide a small degree multitasking by allowing you to run pop-up programs, system enhancements, and background tasks while still inside another application. The problem is that hacks need to operate using space on the dynamic heap, space it shares with the current application and any other active hacks. If the current app or any single hack ever uses too much memory for itself, or if simply the total storage needs of the app and all hacks gets too large, the result is typically a system crash.

Even more critical is a special part of the dynamic heap known as the "stack". The details of how the stack is used are impressively boring to non-programmers, so we needn't go into to that here. What's important is that hacks tend to rely on the stack due to how they interface with Palm OS. The stack is normally only 3.5k in size, so it is easy to exhaust all stack memory, causing a "stack overflow" error or crash when running a lot of hacks. To maintain stability, you need to carefully choose which hacks and programs to run together.

REMOVABLE MEDIA

Removable media storage cards are relatively new to the Palm OS platform, having first premiered on the Handspring Visor in the form of an 8 Megabyte flash Springboard module. Since then, compact flash, Memory Stick, SmartMedia, SD, and MMC cards have all become available. All removable media cards on the Palm utilize flash ROM chips, but how they interface with the OS varies in many important ways from the flash memory used to store the operating system.

The Visor Springboard module behaves most like "normal" memory because it is formatted exclusively for the Palm and is directly accessible by the microprocessor. When the flash module is inserted, the OS simply adds the flash memory onto the storage heap, and files stored there are instantly available to all applications with little or no modification. Programs only need to recognize that the files it finds there are potentially removable and cannot be modified, a relatively small modification for most apps.

Other storage cards, however, use standard data formats and interfaces originally designed for non-Palm devices. This means that they can support hierarchical folders and files in standard non-Palm formats. Unfortunately, this also means that they cannot support the same slick integration with Palm OS enjoyed by Visor flash modules. The microprocessor cannot access the memory directly, and the memory does not appear on the storage heap. This means that programs originally written to work only with normal RAM will not automatically work with data stored on the external cards, at least, not unless their developers were psychic when they wrote them.

Instead, programs must rewritten to use new, relatively cumbersome OS routines to manually copy needed data to working memory before using it. This requires a lot of special code, can cause pauses or delays, and uses up precious space on the data heap as well. Even worse, early expansion devices each had their own proprietary software interfaces, requiring programs to be specially written to support each device. Fortunately, Palm's Virtual File System (VFS) is now a standard under OS 4.0, so we can expect that many future programs will be (re)designed with VFS-compatibility in mind.

GETTING THE MOST OF PALM MEMORY

Hopefully, this little peek under the hood gives you a better understanding of how memory is used on a Palm. Now that you know how the pieces fit together, here are a few tips:

CHOOSING A PALM

When purchasing an organizer, consider choosing one with Palm OS in user-upgradeable flash memory. This includes most models from Palm Computing and the HandEra 330 and TRG Pro. While the Sony Clie uses flash memory, it's not user-upgradeable, so future OS updates, if they are even made available, would likely involve a costly visit to an authorized service center.

An upgradeable operating system means that your organizer won't be left behind when Palm OS is upgraded to fix bugs or support new features and add-on devices. While it's technically possible to do limited updating via files stored in RAM, neither Palm nor Handspring have a good record of releasing RAM-based patches. So, beware of marketing talk that suggests otherwise--flash memory is the best choice if OS upgrades are important to you. Keep in mind, however, that any OS upgrades have to come directly from the device's manufacturer. Also, Palm OS has grown to 2.3 Megabytes in OS 4.0, so older Palms with only 2 Megabytes of flash may not be fully upgradeable past OS 3.5.

USING FLASH UTILITIES

A side benefit of using a Palm with flash memory is the extra storage that can be gained by moving files into the flash not used by the operating system. Flash utilities include FlashPro by HandEra/TRG (http://www.handera.com), and JackFlash (http://www.brayder.com). While some apps may not properly support data files stored in flash, it's almost always safe to move the apps themselves. A side benefit is that files stored there will also survive a hard reset of the Palm, where all other data and programs are erased. This is useful for programs like TealLock (http://www.tealpoint.com/softlock.htm), which can be placed in flash with a special settings file to maintain functionality even after a hard reset.

MANAGING STORAGE MEMORY

Even with a flash utility, if memory on the storage heap is getting low, you can sometimes still free up memory by deleting unwanted applications and files. We suggest first deleting non-TealPoint applications and data ;). Most people use the system delete screen to delete applications, but special care should be taken when doing so. The system delete screen is not designed to delete individual files, but entire applications and all their associated files with a single tap. Each single entry in the system delete screen can actually represent many individual files, grouped together under one entry by an internal 4-letter code that every Palm file has, called a Creator ID. For instance, if you try to use the system delete screen to erase what looks like a single doc file, you will instead -- yikes! -- remove ALL doc files from your Palm at once.

A better alternative is to use the delete functionality of a third party file manager application. There are several out there that will do the job and will also let you see details about the file like size and Creator ID. We actually offer two file managers ourselves. The first, TealFiles (http://www.tealpoint.com/softtool.htm), is a pop-up desk accessory that can manage, delete, and beam files in RAM, and is part of the TealTools pop-up utilities package. The second application, TealMover (http://www.tealpoint.com/softmovr.htm), is a standalone app that also supports files stored externally in VFS devices like SD and MMC cards.

MANAGING HACKS

On Palm OS organizers, the design of both the operating system and individual apps can sometimes lead to problems. As Palm OS was designed to run only one app at a time, it has few facilities for managing memory between concurrent programs. Yet apps, when tested by their manufacturers, are often run only by themselves. Consequently, adding hacks, DAs, language-support add-ons, and other programs that extend the operating system can occasionally exhaust the dynamic heap or stack, causing crashes in certain combinations. While one could simply choose not to use such add-on programs, they often provide overwhelmingly useful functionality that cannot easily be ignored.

What, then, can one do to maintain stability? First of all, be picky selecting which apps and add-ons to run. Quality developers with experience writing Palm apps are much more likely to have tested their programs with hacks and other add-ons, particularly if the developer makes more than one or two programs. Also, be selective when building a collection of hacks and add-ons. Some all-purpose, "do everything" hacks place high demands on the stack, an unnecessary risk if you don't need all the functions they provide. Lastly, since stack size will always place a finite limit on how many hacks can run at once, try deactivating individual hacks when you don't need them, or when they conflict with a certain app or other hack. If you are running TealMaster as your system extensions manager (http://www.tealpoint.com/softmstr.htm), you can use its nifty "profile mapping" feature to automatically deactivate and reactivate hacks depending on what application you are running.

EXTERNAL STORAGE DEVICES

When choosing an organizer, also consider external storage devices. Handspring Visors support, along with numerous expansion peripherals, the Springboard flash module (http://www.handspring.com). This is arguably the most compatible and fastest removable card because its memory is directly accessible by programs and the microprocessor. Yet, Springboard modules cannot be used on other organizers, are only currently available in 8 or 16 Mb sizes, and cannot store non-Palm formatted files like unconverted text and wave files. Also the file management system is non-standard and proprietary, so your choices are limited on how to move files to and from the card. When considering other expansion technologies, look for support for the standard Virtual File System, which will likely be adopted my most new apps. VFS is supported by the new devices from Palm (http://www.palm.com), Sony (http://www.sony.com), and HandEra (http://www.handera.com). Non-VFS devices like the MemPlug SmartMedia Adapter also available (http://www.portableinnovation.com). Third-party VFS support for such devices will likely be available using add-on software like the add-on library in development from Kopsis Engineering (http://www.kopsisengineering.com).

CONCLUSION

So concludes our tutorial on Palm memory. We hope this information has been useful. Now you know that "memory" on a Palm is a term that can mean many things. Hopefully, understanding a little of this complexity will help you enjoy your organizer to its fullest.

<<previous articlenext article >>

Home  |  Software  |  Add-Ins  |  Guides  |  Community  |  Press  |  Support  |  Site Map

This site is best viewed at 800x600 with Internet Explorer 4.0 or Netscape 4.0 or higher.
(c)1997-2008 TealPoint Software All rights reserved.