-
Notifications
You must be signed in to change notification settings - Fork 470
Memory leak in WebHandler.AFFORDANCES_CACHE #1405
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
Comments
While technically we're using a |
We now use a ConcurrentLruCache limited to 256 entries instead of a ConcurrentReferenceHashMap to cache Affordance instances to prevent the cache from growing unboundedly before GC kicks in.
Hi! It looks like this PR makes big performance regression for my project. As there is a contention on LRU cache locks. We're creating thousands of links concurrently and threads have to wait for each other. @odrotbohm could you revert that PR? Here you can see part of profiling my app: Before that change there is no wall-clock time on that locks. The reason of that is the |
@odrotbohm just to show you the scale of the problem that @wyhasany described - we had to downgrade Spring Boot from 2.4.3 to 2.4.1 because average response time in our project increased 10 times, from 7ms to 70ms |
Would you mind opening a new ticket to properly keep track of the problem? |
@odrotbohm ofc, I'm just doing it |
Uh oh!
There was an error while loading. Please reload this page.
I recently upgrade my app from a very old version of spring-boot (and hateoas) to the latest boot and hateoas v1.1.2.RELEASE. After this I am seeing a spike in memory usage. Heap dump points to
WebHandler.AFFORDANCES_CACHE
consuming most of memory. Looking at WebHandler it seems that the cache is never cleared and is unbounded... has anyone faced this issue ?Here is the link to a simple project which exposes a /users/{id}. If we call this api with enough distinct id values, it causes AFFORDANCES_CACHE to fill up. https://github.com/ravishrathod/spring-hateoas-memory
The text was updated successfully, but these errors were encountered: