coolOriginally posted by: rjain
The MacOS (before X) used handles, which are what you describe in your second question.
it seems to me that without heap compaction, if your computer has been running for an extended period of time, many of your processes will have their VM usage at whatever the peak possible is... so while with paging, it may not be a huge problem, it means you would have a bigger swapfile than you would need otherwise. right?There was a call that would compact the heap and adjust the handles to point to the new locations. Really, a good generational GC is just easier. 🙂
Yeah, there are issues, and I think BSD and Linux 2.4 can let the app/libc use madvise() to indicate that a block of memory below brk is unused and can be unmapped. Typically, it's not that huge of a problem except with very specialized allocation and deallocation patterns when using manually managed storage. Even GC'd systems don't bother unmapping after copying or compacting, as the space is typically going to be used up to trigger the next GC anyway.Originally posted by: CTho9305
it seems to me that without heap compaction, if your computer has been running for an extended period of time, many of your processes will have their VM usage at whatever the peak possible is... so while with paging, it may not be a huge problem, it means you would have a bigger swapfile than you would need otherwise. right?