Runtime Memory Organization: Code, Static Memory
Runtime Memory Organization
The organization of memory at runtime depends on the type of language (declarative, imperative), the compiler, and the operating system.
General Structure of Programming Languages
When you run a program, the OS loader allocates the required amount of memory and loads the code to be executed (stored in a file) into the code area.
The OS should detect collisions between the stack and the heap. In these cases, the program may abort, or the amount of allocated memory may be increased.
In memory paging systems, the above scheme can be fragmented and scattered between real memory and the virtual memory system.
Any reference to a storage location within the code should be relative to the position assigned to the process by the...