Skip to content
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

Bound the size of cache in deprecation logger #16722

Closed
wants to merge 1 commit into from

Conversation

andrross
Copy link
Member

The current implementation of the map used to de-duplicate deprecation log messages can grow without bound. This replaces the ConcurrentHashMap implementation with an o.o.common.cache.Cache implementation configured for a fixed maximum size. To reduce memory overhead, this also changes to storing only a hash of the key instead of the full text since we never need to retrieve the original entry.

Related Issues

Resolves #16702

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

The current implementation of the map used to de-duplicate deprecation log
messages can grow without bound. This replaces the ConcurrentHashMap
implementation with an `o.o.common.cache.Cache` implementation configured for a
fixed maximum size. To reduce memory overhead, this also changes to storing only
a hash of the key instead of the full text since we never need to retrieve the
original entry.

Signed-off-by: Andrew Ross <[email protected]>
Copy link
Contributor

❌ Gradle check result for 83514e1: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@andrross
Copy link
Member Author

Accidentally pushed this dev branch to the wrong repo. Will open a corrected PR against my user fork.

@andrross andrross closed this Nov 26, 2024
@andrross andrross deleted the deprecation-logger-cache branch November 26, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Other
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] DeprecationLogger - Unbounded memory usage
1 participant