-
Notifications
You must be signed in to change notification settings - Fork 778
do not deep copy history entries #3248
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
Conversation
Pull Request Test Coverage Report for Build 5467
💛 - Coveralls |
opengrok-indexer/src/main/java/org/opengrok/indexer/history/FileHistoryCache.java
Show resolved
Hide resolved
opengrok-indexer/src/main/java/org/opengrok/indexer/history/Repository.java
Show resolved
Hide resolved
opengrok-indexer/src/main/java/org/opengrok/indexer/history/FileHistoryCache.java
Show resolved
Hide resolved
opengrok-indexer/src/main/java/org/opengrok/indexer/history/FileHistoryCache.java
Outdated
Show resolved
Hide resolved
opengrok-indexer/src/main/java/org/opengrok/indexer/history/FileHistoryCache.java
Show resolved
Hide resolved
@vladak what repo might have required the deep copy? It was quite explicit, so wondering if you’ve accounted for all use-cases. |
I tried to come up with a reason for this code and could not find any, at least w.r.t. tags. |
For this one I think the risk is worth the benefit. |
I'm skeptical firstly because you're removing code conditional on |
Right, I should have measured this first. Will try once indexer can gather JVM statistics (#3245). |
I think it did not do much for my case because the overall memory overhead just trumped the benefit of this change by large margin. |
d91d17e
to
7079ff6
Compare
Turned out my hunch was correct. I chose the same working set as in #3243 and same indexer options (obviously including -G) and same source code basis to avoid running Here are JVM used memory graphs without and with the fix: Both graphs show complete indexing process. This is first such time we have introspection into what is happening there. The first steep fall in the graphs correlate with the finish of the In overall this saved some 6 GB of heap on average during the history cache creation phase. It might impact only a small subset of repository types however Git/Mercurial are widely used so the impact is high. Side node: beware, exporting indexer metrics over statsd can quickly consume your mobile data plan limits as it can easily generate GBs of traffic. |
The reason why this did not help with the case described in #3243 is that the effect of this change is visible only after the acquire of history entries has finished and the issue prevents that from completing. |
7079ff6
to
152093a
Compare
152093a
to
c6fdd29
Compare
This was meant to help a bit #3243 however it does not do much for my particular use case as described in the issue. Still, should save some heap memory in case of running the indexer with -G.