Someone asked around 27:00 about whether the OS needs to use some storage allocation algorithm, and the lecturer replies "no, the OS just gives a large chunk of memory (via malloc)". I'm confused by this. Suppose program 1 and 2 are running. Program 1 requests memory, program 2 requests memory, then program 1 frees its memory. Doesn't this leave us with fragmentation in ram? To ask another way - When you request 4 gb of memory through malloc, are you guaranteed to receive a contiguous 4gb chunk, or could it come back as several smaller chunks somehow linked together? (Maybe I'm just not understanding how virtual memory works...)
*My takeaways*
1. Stack 1:14: allocation, deallocation
2. Heap
- Memory leak, dangling pointers, double freeing, memory checkers *(AddressSenitizer, Valgrind)* 5:36
- Fix size allocation 11:07
- Variable-size allocation 19:35
- Storage layout of a program 27:10
- Virtual memory can impact performance significantly 29:50
- Analysis of binned free lists 31:48
- Coalescing 34:05
3. Garbage collection
- Reference counting 35:46
- Mark-and-Swap 44:22
- Stop-and-Copy 50:15
4. Summary 1:03:03
Someone asked around 27:00 about whether the OS needs to use some storage allocation algorithm, and the lecturer replies "no, the OS just gives a large chunk of memory (via malloc)". I'm confused by this. Suppose program 1 and 2 are running. Program 1 requests memory, program 2 requests memory, then program 1 frees its memory.
Doesn't this leave us with fragmentation in ram? To ask another way - When you request 4 gb of memory through malloc, are you guaranteed to receive a contiguous 4gb chunk, or could it come back as several smaller chunks somehow linked together? (Maybe I'm just not understanding how virtual memory works...)
Thanks
alloca is deprecated? what really?
"seems there are a lot less people today"
also a lot less *comments* i might say :)
Wouldnt using DFS simplify the process by lot instead of BFS in Stop and Copy algo?
Next video is ua-cam.com/video/d5e_YJGXXFU/v-deo.html
What is stack? Please explain
Its a linear data structured ordered so that you can only deal with data at the most recent end of the structure.
en.wikipedia.org/wiki/Stack_(abstract_data_type)