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

Switched implementation of MpEnvironmentVariablesSource to use an LRU cache #8768

Merged
merged 2 commits into from
May 20, 2024

Conversation

spericas
Copy link
Member

@spericas spericas commented May 16, 2024

Description

Switched implementation of MpEnvironmentVariablesSource to use an LRU cache and avoid an OOM. See issue #8767.

…t in an OOM exception. See issue 8767.

Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
@spericas spericas added this to the 4.x milestone May 16, 2024
@spericas spericas self-assigned this May 16, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label May 16, 2024
Copy link
Member

@tomas-langer tomas-langer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I agree with this, as now for each property that is not part of the environment variables, we will have to go through all the steps again, whenever it is requested.

Can we maybe replace the cache with our io.helidon.common.configurable.LruCache that has a configurable size?

This use case is wrong, and is actually expected to break us - and it would break SE Config as well, as we are intentionally caching the whole configuration tree.

@spericas
Copy link
Member Author

I am not sure I agree with this, as now for each property that is not part of the environment variables, we will have to go through all the steps again, whenever it is requested.

Can we maybe replace the cache with our io.helidon.common.configurable.LruCache that has a configurable size?

This use case is wrong, and is actually expected to break us - and it would break SE Config as well, as we are intentionally caching the whole configuration tree.

Understood, let's consider that and also possibly using filters. I will close the PR for now.

@spericas spericas closed this May 16, 2024
@spericas spericas reopened this May 16, 2024
… still cache the missed lookups. See issue 8767.

Signed-off-by: Santiago Pericas-Geertsen <santiago.pericasgeertsen@oracle.com>
@spericas spericas changed the title Avoids caching misses, as these may grow the internal cache and result in an OOM exception Switched implementation of MpEnvironmentVariablesSource to use an LRU cache May 16, 2024
@spericas spericas modified the milestones: 4.x, 4.0.9 May 16, 2024
@spericas spericas merged commit c837dd7 into helidon-io:main May 20, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x config OCA Verified All contributors have signed the Oracle Contributor Agreement. performance
Projects
Backlog
  
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

2 participants