Use malloc_trim on Term reset_state #8155
Draft
+10
−0
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.
This prevents the memory with glibc allocator from sticking around and just results in address space fragmentation until you close the given alacritty window.
--
I'm not sure how good idea that is, but it seems to kind of solve #5438 .
This issue is also less noticeable with the default mimalloc settings.
The main issue with this thing is that it's relatively slow when you have a lot of junk and it's likely not a great way to solve this, but it really seems that we're just fighting the allocator.
probably the better option is to figure out what exactly breaks the ability of glibc allocator to release everything back.
Draft because I have no idea whether it's a good solution for that...