Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Ask malloc to free kernel pages on GC collection #1072
This reduces the max memory usage used by asking malloc to free memory
PS: just want to say this isn't ready for merge yet, as not all libc's (though most) have malloc_trim
2 times, most recently
Mar 20, 2019
referenced this pull request
Mar 23, 2019
OK, nice! But why 128KiB?
Given how memory-hungry rakudo is, wouldn't it be better to have that argument much larger (probably in megabytes)?
See also: https://dev.to/evilmartians/cables-vs-malloctrim-or-yet-another-ruby-memory-usage-benchmark-3emo (TL;DR in some cases there's a performance hit)
How often do we run gc? Do we actually need to run malloc_trim as often?
We really need a way to benchmark this…
There is no
Edit: OpenBSD frees memory pages when needed. I'll need to test
A couple problems though:
This part of the fix might be better off in a separate pullreq.