Skip to content

Resizeable memory maps #17

@ysbaddaden

Description

@ysbaddaden

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).

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions