Demo: Allocation Changes the List of Areas¶
Four megabytes with malloc() and with mmap(), in one call and in 1024, while pmap watches.
Run¶
Two terminals. First:
Second, at every prompt:
Then the same with ./memory_ops_pages.
Ask¶
- One
malloc()of 4 MB: a new area or a larger heap? And 1024malloc()s of 4 KB? - 1024
mmap()calls, four new lines inpmap. What happened to the other thousand? - Read the
RSScolumn: 4,108 KB for the heap, 0 for the 4 MB mapping. Both are 4 MB of address space. What is the difference?