-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[GR-47106] Return to separate CUs per class to improve gdb startup time #6937
Conversation
substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/ClassEntry.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/ClassEntry.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/ClassEntry.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/DwarfDebugInfo.java
Show resolved
Hide resolved
Thanks for the review Fabio! |
Of course, thanks for addressing. While we're waiting for Paul's review, I've started the integration process already and am running the internal gates on this. |
substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/DirEntry.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
As mentioned in Karm/mandrel-integration-tests#160 (comment) it still feels slow but it's about 3x faster on my machine
@adinn please fixup the commits
into a single commit. Also it would be nice if the commit message would all start uppercase. |
style fixes style fixes more style fixes
Done. |
substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/DebugInfoBase.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/ClassEntry.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/ClassEntry.java
Outdated
Show resolved
Hide resolved
Hi @adinn, we failed to integrate this due to a few memory-constraint jobs that are now reliably failing with your changes, either because they're running out of memory or because they're killed by the deadlock watchdog (very likely also because the GC is very busy and slows down the creation of debuginfo). Before we increase the memory limits of these jobs, could you maybe check whether there's something that can be done to bring the memory usage back down? Here's an example stack trace from a watchdog-killed job:
|
Hi, @fniephaus. Sure, I'll create some heapdumps and analyze them to see if I can find some obvious thing that accounts for the extra memory use. |
Hi @fniephaus. I looked at what was driving the high memory use in the debug info generator and have managed to remove a lot of the overhead. The problem was to do with keeping track of debug info references originating from the
In these 3 cases the reference is across a compile unit (CU) or section boundary and so needs a relocatable offset for the reference. By contrast a reference within a CU can use a CU-relative offset with no relocation (if the CU moves it remains valid). There were (are still) other links that required relocations but these three categories dominate. In particular, the count of these references (and hence the resulting reloc count) is determined by the total number of nodes in the inline tree for case 1 and by the total number of parameter location nodes attached to those inline tree nodes in cases 2 and 3. So, the overhead is very dependent on how many info points/source positions there are and the depth of inlining in the inline trees. n.b. the My first attempt at a fix was to ensure all the I'll explain what I did to improve cases 1 and 2, just for the record and also provide some before and after numbers ot give an idea of the scale of the problem. The reloc overhead is minimized by changing the info model to employ a combination of link indirection and DIE cloning. Each inlined_ The parameters and locals from the original declaration are now cloned under the This makes a big difference to the amount of reloc storage employed. I took some before and after heap dumps running the test program which manifested the gdb startup problem that prompted this patch. n.b. this is the worst case scenario with full debug infopoint and source position generation i.e. the command line included the following options:
The count of inline subroutines and inline parameter/local DIEs can be approximated by grepping keyword
The split between the two types of DIE can be approximated by counting The heap dump revealed the following summary storage costs related to info section content and reloc management:
The corresponding instance counts for the latter two types are
Looking at individual
So, although the info section byte array has increased slightly in size (thanks to both the new and cloned DIEs), this is more than made up for by the reduction in the size of the associated reloc section. Looking at individual
Note that the absolute numbers and ratios for the |
@fniephaus The latest (espresso) gate failure appears to be unrelated to this patch. I think this is ready to be resubmitted to the internal gate. |
Fantastic, thanks a lot, @adinn! Let me run the gates again and see whether it passes our benchmarking infra. :) And special thanks for the detailed analysis report. I always enjoy reading them!
No need to worry about it. We're already working on fixing that. |
Well, indeed, much as I do when it is 6 months down the line and I have near zero recollection of what changes I made or why I made them ;-). All the same, your words of appreciation are gratefully received. |
... and we're past the failing gates, yay! Thanks for fixing...getting this merged now (see #6984). |
This patch restores the DWARF debug info generator to generating a compilation unit (CU) per Java class. This helps alleviate the performance problem identified in issue #6936.