Dynamic Areas

A new memory management feature in RISC OS 3.5 and later

Under RISC OS 3.5 or later, applications can make use of Dynamic Areas. These are resizeable blocks of memory which an application can claim and give a specific name. They can be any size, limited only by free memory.

Previously, applications may have allocated memory in several ways, all of which worked but were not ideal. The worst was through claiming memory in the Relocatable Module Area, or RMA. This practice led to increased fragmentation of the RMA, which basically meant it grew in size over time and you may eventually have needed to reset the machine to free up the memory it was using.

The second method was to use the System Sprite area. Applications such as SparkFS do this on pre-Risc PC machines. This works a little better than the RMA since fragmentation is less likely to occur, but the sprite area was not designed for this use and several problems are associtated with it.

The last method was to extend the memory allocated to the application directly, though this can't be done under all circumstances as an application's memory is handled in a special way. This also has other problems, and on the Risc PC, a large amount of memory allocated to a single task will slow down the machine. Furthermore, you can only have up to 28Mb allocated to any one task.

Dynamic Areas solve all of these problems, giving an area which an application can name to show the user clearly what it is for (through the Task Manager display). They are easy to deal with and were thankfully designed for the task of storing an application's data. As mentioned above, there is no limit to their size, within the limits of the machine's memory. The way that they are handled allows Virtual Memory (that is, using hard disc space as 'slow' memory) solutions to be implemented successfully.

The only problem with a Dynamic Area is that it can't easily be removed from the Task Manager list, whereas application tasks can be. Some badly behaved tasks may leave Dynamic Areas behind if they crash, and you either need to run another application (e.g. !RemoveDA by Dave Thomas, cmsdthom@livjm.ac.uk,) or reset the machine to remove them. SwiftJPEG uses its own Dynamic Area, but it's reasonably well behaved and the area will be removed should the application crash. Note that if you use the 'Watchdog' (Alt+Break) to kill the application, then the area will be left behind as SwiftJPEG is not given any chance to shut down properly before being killed off.


Go back to the Contents page.