[ Go to October 1997 Table of Contents ]

Windows CE /
John D. Ruley

Jog WinCE's Memory

It's late, and you're on deadline. You've been working on a report on your Windows CE-based Handheld PC (HPC), switching between Pocket Word, a Pocket Excel spreadsheet and your Contacts database. You've picked up some additional information browsing the Web with Pocket Internet Explorer. All you have to do now is check your e-mail and you can call it a day.

But when you double-tap the Pocket Mail icon, the dreaded "Program memory is critically low" message appears. It advises you to close down one or more applications or "Convert 20KB of storage memory to program memory."

I didn't make up this scenario-it really happened to me. And if you try to juggle a few apps on a CE machine, it's likely to happen to you. The best way to prevent this is to understand program memory and how you can get more of it.

HPCs contain two kinds of memory-ROM and RAM. ROM is hard-coded, read-only memory. It stores Windows CE and the HPC's built-in applications. RAM is like the RAM on your PC; you can read from or write to this memory at will. However, Windows CE makes a distinction between program RAM and storage RAM. Program memory is available to any application, same as on a PC. Storage memory is the HPC's substitute for a hard disk. When CE stores files, it compresses them for maximum efficiency.

Non-built-in applications are treated differently. Before you execute one of these programs, it's in storage memory. Once the program starts, it uses program memory-uncompressed for maximum speed. When you save a file, it goes into storage memory-compressed. When you exit a program, the program memory it was using becomes available for use by other programs.

You can control how much RAM is allocated for storage memory vs. program memory by adjusting Windows CE's settings. Double-tap the System icon, select the Memory tab, and you'll see the System Properties dialog. It contains a slide control, with Storage Memory on one end and Program Memory on the other. You can adjust the slide to allocate more storage at the expense of programs or vice-versa-up to a point.

Sometimes the slide control refuses to move past a certain spot, which will happen if the memory you want to allocate is already in use. Or the control can stick because of memory fragmentation caused by running your HPC for a long time without a reset-especially if you're low on memory. The memory manager may be unable to coalesce memory as programs release it. When this happens, you see the "Program memory is critically low" message. You can't get rid of it-even after closing all open programs and repeatedly checking the "Convert 20KB of storage memory" box. You must reset the HPC.

Although it rarely happens with a 4MB HPC, memory runs out quickly on a 2MB unit. Thankfully, you can upgrade HPC memory.

Adding memory

The amount of memory you can add and how you add it varies among different vendors' HPCs. Generally, adding RAM to an HPC involves removing a cover (usually on the bottom of the unit) to reveal a socket, which might already have a memory chip installed. Then you plug in a new memory chip (replacing the old one, if necessary). Unfortunately, these chips are different than conventional PC memory. Each HPC brand has its own socket configuration and requires a special chip specific to its particular model. Casio HPCs accept 2MB upgrades, up to 6MB-you can go from 2MB to 4MB or from 4MB to 6MB. The HP 300LX and 320LX can expand to 8MB. Other makes and models vary, so check with the manufacturer.

But even after plugging in all the memory the vendor supports, you haven't reached your limit. HPCs can also use external memory.

All HPCs accept plug-in modems and other devices. They have either a PC Card slot or proprietary connectors. The Philips Velo 1, for example, uses a V-Module miniature connector, while the HP 300LX and 320LX have both a PC Card slot and a CompactFlash Card slot (no, it's not the same as the Philips V-Module).

All HPCs accept Synchronous RAM (SRAM) or ATA Flash RAM, but they don't support the older, "linear" flash RAM. SRAM is basically a card with conventional RAM and a battery that keeps it operating even when you remove the card from the HPC. It's fast, but expensive, and capacities tend to be low (from 1MB to 4MB). ATA Flash RAM requires battery power only while data is being read from or written to the cards, so it can tap the HPC's power source. It's much cheaper and comes in larger capacities (4MB and 8MB are common, 20MB and 40MB are available) than SRAM.

You should think of both ATA Flash and SRAM as solid-state disks. Memory added this way doesn't appear in the CE Control Panel, and you can't use it as program memory. But you can make more internal RAM available as program memory by moving files from internal RAM to the SRAM or ATA Flash Card. Because ATA Flash Cards are standardized, you can also use them to move files between HPCs and other devices with PC Card slots-just like you would with a floppy disk.

How do you put data into external RAM? First, plug in one SRAM or ATA Flash Card. Even if your device has more than one slot, Windows CE will only recognize a single

external card. Next, reset your HPC, then turn it on and double-tap the My Computer icon. You'll see a PC Card folder. Paste any file on your HPC into the PC Card folder. That moves the file to the external card and frees the memory the file was using.

A few things to know before running out and buying a card: First, not all cards will work. The Microsoft Web site (http://www.microsoft.com/windowsce) has a list of compatible cards. Second, while you can copy almost any file to an external card in principle, in practice this is mainly useful for data files. If you move programs to the PC Card without going through an uninstall/reinstall cycle, you're likely to wind up with a program that won't work.

Lack of speed might also be an issue when you're using ATA Flash RAM. When I ran WINDOWS Magazine's Word and Excel tests on a Casio Cassiopeia A-10 HPC with an 8MB SanDisk Flash Card, it took twice as long to load large files as when I used internal memory. However, that's just a few extra seconds for normal-sized files, and it tripled my HPC's capacity.

Since you can upgrade HPC ROM, it should be possible to upgrade to Windows CE 2.0 (due out later this year) via a ROM upgrade.

Senior technology editor John D. Ruley is principle author of the book Networking Windows NT 4.0 (3rd Edition), published by John Wiley & Sons. Contact John care care of the editor or the addresses on page 20.


Windows Magazine, October 1997, page 279.

[ Go to October 1997 Table of Contents ]