Next: Metadata and Method Dispatch
Up: System Components and Implementation
Previous: System Components and Implementation
The MemorySource base interface encapsulates the memory allocation
facility. It provides just one function, called ``getMemory,'' which
takes the size of the memory block required, and returns the resulting
block.
The current implementation has seven MemorySources, which can be used
alone, or in combination, to produce a wide variety of effects:
- MallocMemorySource calls the standard C malloc function to
allocate memory.
This was useful early in development of the system.
- BoehmMemorySource calls the Boehm conservative garbage
collector [12].
- BoehmAtomicMemorySource also calls the Boehm collector, but it
marks memory chunks as being pointer-free (that is, atomic).
This is useful to prevent the garbage collector from unnecessarily scanning
for pointers within large arrays of non-pointer data.
- ArenaMemorySource doles out chunks of memory from a given
contiguous block, called an arena.
- MemoryCounter keeps track of which parts of Jupiter have
allocated the most memory.
This is useful in debugging to help reduce memory usage.
- Tracer annotates each memory block with information that allows
for memory profiling.
This is useful to diagnose cases when memory is not being garbage-collected
properly, to find out why memory is being retained.
- ErrorMemorySource reports an allocation error when called
from specified points within the Jupiter source code.
This is useful for testing Jupiter's error handlers, by
injecting errors into Jupiter that are otherwise difficult to reproduce.
Next: Metadata and Method Dispatch
Up: System Components and Implementation
Previous: System Components and Implementation
Tarek S. Abdelrahman
2002-05-27