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

useMalloc for standard GC #16761

Closed
wants to merge 13 commits into from
Closed

Conversation

arnetheduck
Copy link
Contributor

@arnetheduck arnetheduck commented Jan 19, 2021

Closes #15394

unoptimized, malloc-based allocator for the GC - uses less memory, is a
bit slower for small chunks, less code

ringabout and others added 3 commits October 28, 2020 13:16
unoptimized, malloc-based allocator for the GC - uses less memory, is a
bit slower for small chunks, less code
@arnetheduck
Copy link
Contributor Author

arnetheduck commented Jan 19, 2021

Using this branch halves the memory footprint of nimbus, as measured by RSS in linux (400 mb instead of 800).

It's not intended for production use really, more as a debugging tool - it's branched off the beginning of the 1.2 release cycle roughly, so can easily be applied to any version after that.

@Araq
Copy link
Member

Araq commented Jan 20, 2021

Does it support the alignment requirements that the conservative stack scan needs?

@arnetheduck
Copy link
Contributor Author

Does it support the alignment requirements that the conservative stack scan needs?

well, it assumes 8-byte alignment on anything coming out of malloc and redefines pageIndex and boundary checking accordingly - seems to work no worse than the "normal" GC allocator, judging by GC tests and nimbus (which is a long-running memory-allocation-heavy process).

Nimbus is the reason this branch was written - we're having GC-related crashes and it's unclear what the culprit is: unfixed bugs in the cycle collector like #4851 and #10625 or the pointer tricks we sometimes subject the code to, that perhaps break the scanner.

@Araq Araq closed this Jan 25, 2021
@Araq Araq reopened this Jan 25, 2021
@mratsim
Copy link
Collaborator

mratsim commented Feb 9, 2021

Closes #15394

@arnetheduck
Copy link
Contributor Author

the test fails here are likely because this was branched off where 1.2.0 was released which might be missing some commits to update test scripts

@arnetheduck
Copy link
Contributor Author

Oh, and with something like tcmalloc you regain most of the lost performance - there are a few obvious improvements one could make which probably would bring the performance up to par - in particular, this branch has a large per-allocation overhead that mostly could go away, but it was simply more easy to write it this way so that one wouldn't have to modify the rest of the gc

@Araq Araq closed this Feb 22, 2021
@Araq Araq reopened this Feb 22, 2021
@Araq
Copy link
Member

Araq commented Feb 23, 2021

Ping @arnetheduck, can you please rebase?

@ringabout ringabout closed this Mar 29, 2021
@ringabout ringabout reopened this Mar 29, 2021
@ringabout
Copy link
Member

ringabout commented Mar 30, 2021

Sorry for messing up commits messages(maybe you can use force push or somethings to clean the commits messages)
I only fetch the latest commits, didn't change the codes.

@arnetheduck
Copy link
Contributor Author

Sorry for messing up commits messages

I'm a bit unsure what you've done here? did you rebase against devel?

@ringabout
Copy link
Member

yeah

@arnetheduck
Copy link
Contributor Author

hm, the 32-bit issue might be legit, need to recheck some arithmetic

@stale
Copy link

stale bot commented Mar 14, 2023

This pull request has been automatically marked as stale because it has not had recent activity. If you think it is still a valid PR, please rebase it on the latest devel; otherwise it will be closed. Thank you for your contributions.

@stale stale bot added the stale Staled PR/issues; remove the label after fixing them label Mar 14, 2023
@stale stale bot closed this Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Staled PR/issues; remove the label after fixing them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

-d:useMalloc for the default GC
4 participants