The Newton Heap Mini-FAQ

Version 1.5 - August 15 1997

go back to the main page

by Daniel Domberger

Send comments, questions, hints or corrections to :
domby@smileyface.com | domby@innocent.com | danield@gsb.usyd.edu.au

Contents:


Introduction: What is Heap?

Heap, also known as 'Frames Heap' is one of the most common causes of questions from Newton users (probably second only to modem/internet compatibility problems). Part of this is due to the plethora of overlapping names and terms which are frequently bandied about: 'system Memory' is used as a synonym for total installed RAM, which is different from 'Frames Heap', which represents only a small proportion of total RAM. 'Frames Heap' is also distinct from the 'system heap', which is a much larger proportion of total RAM and is used for things like communications, handwriting recognition, and the view system. Confusingly, the 'system heap' is sometimes called 'system memory'.

"The Newton has two kinds of memory, system memory and user storage. System memory is analogous to the RAM memory in a desktop computer, user storage to the storage space on a disk drive. The memory space reported in the Memory Preferences window [Memory Info, in the Extras drawer, for NOS2.x] is for user storage. There are shareware packages that measure system memory (heap space), but it is not displayed by the Newton system software. This system memory is further broken down into different uses, but we won't expand on what they are in this discussion. It is in the system memory that programs actually run and store the intermediate data that they create. Permanent data, as well as the packages themselves are stored in the user storage."
- Apple Technical Information Library article 16645


Back To Top

Heap and Storage

An important distinction to make is that between Heap and Storage. If Heap is like RAM on a Mac or PC, Storage is like hard disk capacity. When you add a PCMCIA storage card to your Newton device, it's like adding a new hard drive. Unfortunately, until Newton Inc. develops 'virtual Heap'(!), there is no way that this storage can increase available Heap. (Actually, there is a technique available to Newton developers to use a form of 'virtual memory' if they wish. It isn't automatic, but it is available. Virtual Binary Objects (VBOs) allow a Newton developer to allocate large chunks of Storage space for use with many of the normal heap functions. It can't be used too often, however, because amounts of available storage vary widely from one Newton & user to another, so developers can't use (say) 250k of VBOs because not all users will have that much space available.)

Back To Top

Understanding Heap

It's often said that Heap is like RAM on a desktop machine. This, however, is a little simplistic. It's important to remember that everything in the Newton is integrated - if you email a Notepad item, the list of email addresses comes from the Names file, for example. Because of this, working on a Newton is kinda like having every single application installed on your Mac or PC open at once, because on the Newt they're all in use, even when you're not actually working in them, and they're all taking up 'RAM'(=Heap) even though you might not be using them at the moment.

This analogy breaks down, however, because Newton applications use more heap when they're actually open & in use, rather than just installed and integrated. In this respect, working on the Newt is almost like having every document on your Mac or PC open, without the application. But try explaining to a computer-literate person that the documents can be open without an application! (The 'documents' are the Soups; this is where the Newton stores its data; apparently they were named this because every application can dip in and ladle out whatever info it needs - like the notepad needing the Names list of email addresses).

"Even when it's not "running", a Newton package can respond to changes in its soups, it can respond to incoming data from modem, network, IR, or even messages from other packages.

"Newton packages can access the data in another package's soup. A fax editor package can make use of the Names soup for its address book. It can get its data from the NotePad, or from an e-mail message. A Contact Manager package can make use of the Names soup to look up contact information. It can schedule items into the To Do list, or the Calendar. Apple calls this Newton Intelligence.

"There are single applications on desktop computers that integrate these sorts of cross functions. These "all in one" applications exist because desktop machines have not yet learned how to have the separate applications work together. As a result, you can't have your favourite address book program communicate with your favorite calendar program to create a contact manager function. The two programs don't talk to one another.

"Newton packages need to always be active in some way. When a package is loaded into the Newton, the package tells the system about itself and its soups. It prepares itself and the system to deal with its soup data and messages it might receive. This causes the package to take up system memory even though the user has not opened it. Again, only a very small amount of memory is used up for this capability."
- Apple Technical Information Library article 16645


Back To Top

How Heap is used

Every installed package takes up some heap: this is required to 'integrate' the package with the Newton. Every installed package needs about 2k of Heap for this integration (Apple Technical Information Library article 18284). This means that if you install enough packages, you'll run out of heap. To reach this level, however, you'd have to install hundreds of packages.

When a package is run, its commands are loaded into Heap much as an application in loaded into RAM when run on a Mac or PC. Intermediate data is also stored in Heap, although it is automatically copied to storage frequently (so an out-of-memory restart should not lose any of your data, even though you don't have to 'save' documents and settings).

Those packages that are always running - because they use statusbar buttons or floating palettes, for example - use relatively more Heap. If they are large and complex, their Heap requirements can slow the Newton down .

Back To Top

Out-Of-Memory Errors

These occur when some package or part of the system made a request for more Heap, and the request failed because the available memory was insufficient. The Newton offers to wipe the slate clean: to restart. Restarting has the effect of flushing the Heap clear; tapping restart on-screen is the same as pressing the Reset button on the back of the MessagePad.

Back To Top

How much Heap is there?

This varies from one Newton device to another.


Back To Top

So how much should I have available?

Well, that depends on what you want to do! Internet browsing, for example, uses a lot more Heap than just the NotePad. Available Heap will vary with your machine and your System version, and what you have installed. In general, though, on a NOS1.x machine you should hope to have between 40-50k; on an MP130, 120-150k; and on an eMate or MessagePad 2000, 95-115k.

Back To Top

How can I tell how much I have?

There is no provision within the basic system software to indicate Heap levels. There are, however, several shareware or freeware packages that will tell you how much Heap you have available. For example, Backdrop Plus (from StandAlone Inc. gives a Heap readout. Trashpak (available from AMUG: http://www.amug.org) also lists available heap. You should, however, bear in mind that any package you open for a Heap readout will itself have to be loaded into Heap, and so the reading may be significantly lower than actual available Heap after the package has been closed. (This is why Backdrop Plus's Heap status indicator is so useful).

NewtInfo (from ICS ) can tell you how much heap different apps are using , which can be extrememly useful.

Back To Top

Can I upgrade my Heap? Can I add more?

If you have an eMate 300, yes, you can indeed. Newer Ram sells an eMate memory expansion module that upgrades the internal RAM to 4 megs/4megs. The snap-in module also changes the data bus from 16 bit to 32 bit, which increases the machine's speed and responsiveness.

If you have anything else, including a MessagePad 2000, you cannot. Sorry.

Back To Top

So what do I do if I'm running out of Heap?

There are several things you can do:

Back To Top

Why is there no HeapDoubler for the Newton?

RAMDoubler on the Mac works by allowing applications to use the RAM allocated to another open program, but not actually in use. Because all Newton packages need to be active all the time, there isn't really anything that a 'HeapDoubler' could do. Standalone's HeapSaver is the closest we'll get, I'm afraid.

Back To Top

Sources & Credits, and Disclaimer

This FAQ was written by me, Daniel Domberger, and is © Copyright 1997, except those passages quoted, for which due recognition has been given. The information in this miniFAQ was compiled from various sources, and general reading about the Newton since 1993, when the original MessagePad was released. Specifically, though, a lot of the more technical information came from the Apple Technical Information Library (http://til.info.apple.com). A lot of it also came from people's responses to Heap-based questions on the Newton Doctor site (http://www.antopia.com/Newton/doctor/index.cgi) - thanks to everybody there!

Others who have helped and/or contributed were:

Remember, though, I'm a politics student, not a Newton technician, or a programmer. If anything I've written here is incorrect, let me know & I'll correct it. Use this information at your own risk. (Very grim, huh?). Also, the product suggestions contained herein do not represents endoresements or guarrantees: they're simply suggestions. If you know of any other packages I might want to mention, or have comments/questions/hints, let me know!
Back To Top

The Newton Heap MinFAQ by Daniel Domberger

domby@smileyface.com | domby@innocent.com | danield@gsb.usyd.edu.au


go back to the main page

1