Measuring Memory Requirements
There are difficulties for determining memory requirements in the usual operating environment of a modern PC:
- Should only the process and toolkit executing be accounted or operating system and display environment (Xorg, console/Framebuffer or Windows) as well? I decided to only determine a memory requirement for the execution of the process that i wrote the program for.
- How deterministic is the reported value? Would the reported size differ on systems with the same software but different hardware capacity? Does the operating system manage commitment of memory to processes ad-hoc, in an adaptive fashion? Could process or operating system be „tuned“ for reducing the amount of required memory? Satisfying answers to these questions are beyond the possibilities of this article, and only a rough comparison of non-optimized environments can be given.
- On a specific note, since DOS is a single-task operating system, there is no easy way to monitor a task while it is running. Since the DOS solution presented here runs in the „real mode“ of the x86 processor, it only has access to 1 MB of memory, and this can be given as an upper bound of this solutions memory requirement (nota bene, including the QuickBASIC intepreter and IDE).
These are the methods of measurement i applied:
- On GNU/Linux i determined VM resident set size (RSS) as reported by /proc/$PID/status.
- On Windows i determined the private working set size (PWSS) using Visual Studio’s profiling session.
- For a real mode DOS application, i assume 1.024 kB as upper bound for memory requirement; CPU load is not available.