ARROW-6994: [C++] Fix aggressive RSS inflation on macOS when jemalloc background_thread is not enabled #6100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In investigating ARROW-6994 and ARROW-7305 I was shocked to find the following behavior from this test script https://gist.github.com/wesm/193f644d10b5aee8c258b8f4f81c5161 (requires data file attached to ARROW-7305)
this is what I see both on master and 0.15.1
This contrasts with Linux where RSS stabilizes around 170MB at the end. The macOS behavior on 0.14.1 is slightly better, though RSS ends up at ~465MB after the script runs.
When the background thread option is disabled this patch sets the decay time for unused memory pages to 0 so they are released immediately to the OS. Without understanding more about what's going on the current behavior on master this seems better than releasing again what is currently there. With this patch I have