Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-19392] Simpler and more efficient to use String.intern…
… to compact fingerprint data. This should work across builds and even across jobs, and does not force us to load other builds.
- Loading branch information
Showing
2 changed files
with
11 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2f59ffc
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.
Won't this result in perm gen memory issues?
2f59ffc
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.
On Java 6/7 you mean (Java 8 is fine)—perhaps. I suspect you would run low on heap and start ejecting
Run
s well before then, which would allowString
s from the fingerprint maps to be collected.I actually initially wrote this to keep a custom intern set but decided to go with the somewhat simpler approach of
String.intern
and let the JVM manage it. If you think it worthwhile I can resurrect the original code. It has the downside that pseudo-internedString
s cannot ever be collected, so on Java 8 it would be strictly worse than the current code.2f59ffc
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.
I don't know the details well enough to judge this. Maybe something to keep in mind when the issue actually comes up on real installs. Jenkins only requires Java 6 after all, and Java 8 isn't even in some of the default Linux package repos.
2f59ffc
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.
The other option is to just delete the compaction altogether (or at least on Java 7-). With the introduction of lazy-loading the intent is that most of the
Run
s will not actually be in memory, so the original purpose of this code becomes less relevant.