-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
GC spends too much time in marking phase #233
Comments
There are two possible causes that come to my mind:
|
@klickverbot presumably the code is there so that static data segments of all loaded ELF files are added as root ranges. I can think of two reasons for that:
So, point 1 is pretty much moot because we have always expected people to take care of this themselves and most people are perfectly aware of that, and really, it'll just obscure things even more when such issues arise. Point 2 also doesn't hold water because it doesn't help if it's not called every time a shared library is loaded. I also think that registration of D shared libraries (once we get there) should be handled completely differently (for instance, an ELF constructor that is run by the dynamic linker once the library is loaded, which registers the library (and its roots) with druntime). I may have overlooked something, but from where I stand, it seems safe to delete all that arcane code in |
@klickverbot I built LDC specifying |
OK, I found a solution.
|
@lomereiter: Depending on your system, you will find that your GC now collects live objects. On Linux, I'd expect that TLS globals/statics are no longer scanned. Working on the optimization flags thing. |
Ouch. Then lines of Using zlib compiled with -O3, I now have following timings for the program I'm trying to optimize: 2.17s - dmd -O -release -inline |
Two versions of druntime/Phobos are now built, and C files are always compiled with release flags. This of course doesn't touch the memory range problem. I'm afraid this will have to wait until after the release. |
Another step towards fixing the issue, but the range we add for TLS is still much to big. Will close when we merge in the 2.063 implementation based on the ELF section headers. |
We use the upstream druntime code for determining the size and location of the TLS segment on Linux now. This should eliminate the problem, and the simple program from the original report now doesn't show the excessive scanning behavior anymore. |
Here are call profiles for a test program unpacking stream of gzipped blocks:
DMD
LDC
As you can see, with LDC garbage collector spends ridiculous amount of time on marking!
This behaviour is also seen in this simple example (compile with -O0/-O1):
My system is Linux x86_64 if it matters.
The text was updated successfully, but these errors were encountered: