Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple: "small object arenas" never shrink #6

Open
Techcable opened this issue May 26, 2020 · 0 comments
Open

Simple: "small object arenas" never shrink #6

Techcable opened this issue May 26, 2020 · 0 comments
Labels
bug impl-simple The simple mark/sweep collector (our first one :D) memory-usage The garbage collector is wasting memory (Java)

Comments

@Techcable
Copy link
Member

This is actually not uncommon among garbage collected programs (Eclipse),
but our collector should strive to do better.

Potentially we could allocate a bunch of objects into an arena, requiring bumpalo to create a new chunk of memory.
Hypothetically a program could stop using the old objects, then never allocate any again (or at least not as many).
Right now, the sweep phase will simply add free objects to the free lists and never attempt to return it to the OS. Even if a chunk of memory is completely empty, we'll still never return it.

In a way, this is related to our dependency on bumpalo since they don't provide an interface to free a single chunk at a time.

Fragmentation of the arenas could also leave a ton of unused memory, resulting in a similar situation. That situation would require a compaction phase, which is out of scope for the simple allocator (just disable the arenas if this is a problem).....

@Techcable Techcable added bug impl-simple The simple mark/sweep collector (our first one :D) memory-usage The garbage collector is wasting memory (Java) labels May 26, 2020
Techcable added a commit that referenced this issue May 27, 2020
Will allow us to do lazy sweeping (#7) and start reclaiming unused chunks (#6).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug impl-simple The simple mark/sweep collector (our first one :D) memory-usage The garbage collector is wasting memory (Java)
Projects
None yet
Development

No branches or pull requests

1 participant