-
Notifications
You must be signed in to change notification settings - Fork 19
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
LazyReferenceManager CPU Usage high #335
Comments
Could you provide more information? I have launched the big load test but did not observe this behavior. Could you also share a simple, reproducible example? Additionally, could you include screenshots showing how you detect this behavior on Windows 11? |
Are you store the data in local disc or some other target? |
Please, calll jstack on this process and send me the thread with LazyReferenceManager... |
We store inside an H2 database (local disk, no network IO), but I've confirmed this happens when storing to disk directly (without an SQL provider inbetween). Created with |
Do you have a change timing on LazyReferenceManager or is all values defaults? |
It's all default, I haven't touched anything. |
Could you please provide the exact JDK version using I currently have no further ideas, but I will try testing on a Windows 11 PC. |
|
Could you please try updating the JDK to version 21.0.5, if possible? |
Makes no difference either. |
Ok, I cannot simulate it on any of my projects. Please provide some code, and I will try to identify the problems. |
I'll provide a comprehensive example once I find the time. |
Environment Details
Describe the bug
When using the default settings for the LazyReferenceManager, it exhausts one CPU core completely.
According to the defaults in the code, the maximum activity (made sure by time budgeting), should be 0,1%.
Reason
It seems that the actual cycles aren't taking that long. Instead the issue seems to stem from calling
updateStatistics()
. This seems to totally blow the budget. I have confirmed this by copying the LazyReferenceManager implementation and only removing theupdateStatistics()
method call. CPU usage instantly went to what the docs for the default settings describe.How to fix it
Given how simple the code looks (its just a loop and some simple ifs basically), I don't think there is much room for optimisation here. Might it be possible to have the cleanup routine track this progress live and make the monitor stateful? This way monitoring would run within the budgeting and won't have to iterate over everything.
Alternatively, I was thinking that it should be possible to disable the statistics altogether if they aren't being accessed anyway.
The text was updated successfully, but these errors were encountered: