-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
GC_map()
currently tells the kernel to allocate as much (virtual) memory as possible, but we could be smarter about it. Instead of asking for as much memory as there are on the computer (thrice), we could tell to map as much as we need, and grow the map as we grow the GC HEAP using mremap(2)
.
Ideally, we could consider to shrink it after a collect (or once every collect) if we could release a significant amount of memory back to the OS.
Note: allocating so much memory causes issues with Valgrind that intercepts the mmap
call and injects the MAP_FIXED
flag which tells the kernel to fully allocate memory, which isn't possible and crashes the program (oops).