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
[DS-2846] Optimize memory usage when using iterators #1131
[DS-2846] Optimize memory usage when using iterators #1131
Conversation
This code currently fails unit tests. The errors seem to always be along the lines of
|
Fleshed out the iterator implementation a bit and this appears to fix the unit tests, but @terrywbrady will need to test if the OutOfMemory problems are solved now. |
@KevinVdV, sorry for the delay in testing this. I concluded that my MaxPermSize for tomcat was set too low. That may have explained some of my issues. I will test this with a larger database instance after I find a resolution for https://jira.duraspace.org/browse/DS-2960 |
@KevinVdV , Since you resolved DS-2960/DS-2913, the behavior of my repository has improved significantly. It has been difficult to isolate the issue behind this PR. I have tested with this change and things look good in my repository. +1 |
REST and XMLUI are behaving well. I initiated a re-index of my repository with 250,000 items. That code encountered a heap issue. I will plan to dig deeper into this issue.
|
@terrywbrady In order to fix: #1276 did you also require this pull request or was yours enough ? If yours was enough, does this PR have an influence on performance ? |
@KevinVdV , sorry that I overlooked your last comment. Testing without this enhancement, a re-index of 250,000 items took 3:08 hours. I will repeat the test with this code merged and post the time to complete the task. |
@KevinVdV , with this pr, my re-index took 3:25 min. Based on this single test, I do not believe that this PR improves indexing performance. |
Perhaps a silly question: but does a scrollabale iterator my have advantages in regards to ConncurrentModificationExceptions we have to fight from time to time? |
@pnbecker I don't think so, you the "ConncurrentModificationExceptions" is due to the fact that all lists returned by hibernate data objects are persisted. So if you iterate over that list & then remove something from it you get the exception. This PR just optimizes the iterators returned by hibernate to use forward scrolling in the hopes that this is more memory efficient. |
Since this PR seems to not be immediately beneficial, I'm going to close it for now. We can always reopen it later if we discover a benefit to the |
https://jira.duraspace.org/browse/DS-2846
Use a scrollable result when returning an iterator, this will decrease changes of getting a heap error.