CSUMB 334 - Week 3

Author

Date Published

Write a 1 - 2 paragraph journal post, of at least 250 words, of what you learned this week in CST 334.


This week I learned about how the operating system manages memory between processes. I learned about how virtual memory is used allocate and distribute memory between multiple processes rather than have each process or program access the memory directly (as one might expect). Virtual memory also includes traps to make sure each program is only allowed to access memory that has been assigned to it. I also learned how the first 2 digits of a memory address can be used to determine which part of the program the address belongs to.

Interestingly, memory allocations are not usually stacked in order but, are distributed. I think that means that the memory that belongs to any one particular program is not necessarily next to each other. I also learned about the concept of coalescing pieces of memory that are actually next to each other. But, I am not very confident that I fully understand that concept.

Most importantly, I learned some pitfalls that lead to memory leaks when writing code. An allocation that is not freed by the end of a function will likely lead to memory leaks. Modern programming languages include a garbage collector which is overhead that mitigates this issue.

Comments

Join the conversation! Login to reply to comments