![]() |
Retro Rocket OS
BASIC-Powered Operating System
|
Retro Rocket handles memory in a way that is both simple for BASIC users and efficient under the hood. This document explains how memory is divided between programs, how it grows, and how it is cleaned up when a program ends.
Area | Description |
---|---|
Operating System Core | Kernel, drivers, and system services. This part is always present and not visible to BASIC programs. |
BASIC Programs | Each BASIC program has its own private heap, managed by a buddy allocator. |
Program Heap | - Starts empty - Grows in fixed-size regions (typically 1MB) - Allocations (variables, arrays, strings) come only from this private heap - When the program ends, its heap is destroyed in one call, instantly freeing all program memory and removing any fragmentation |
Memory Reporting | - MEMPROGRAM → shows the program’s current live usage - MEMPEAK → shows the program’s highest memory use during this run - MEMUSED → shows the whole system's memory usage - MEMFREE → shows the whole system's memory free amount |
Other Subsystems | Certain subsystems (like ACPI during boot) also get their own heaps, which are discarded when no longer needed. BASIC users usually don’t see these. |