Alternate (more comprehensive) view of the content of the RAM memory:
(I am using a 1000000 byte RAM memory in the example - that's why the last address is 999999)
|
Example: create one variable
We have used the memory cell with address 1000 to store the value of the variable
|
Answer:
|
|
The next time a variable is created, the system knows that the memory location 2000 is used !!!
The memory locations 2000, 2001 and 2002 have been marked as used.
Furthermore, the memory call can be re-used by some other variable !
|
|
|
Problem with this approach:
|
|
|
|
|
|
|
Explanation:
|
|
I.e., only the program instructions and class variables are stored in RAM:
(Since we do not learned about class variables, our example only has program instructions)
|
|
Therefore:
|
This area is called the System heap.