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

Support to change the percentage used for calculating default low-units #96

Open
javafanboy opened this issue Feb 23, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@javafanboy
Copy link

If you don't specify a value for "low-units" (or specify 0) the value used is today calculated as 0.75 * high-units.

It would be very nice to be able to set this percentage to another value than 0.75 and in this way not having to specify an explicit calculated value for "low-units" for every cache as soon as you would like another percentage.

Perhaps there is already a parameter or method for overriding this but in that case we have failed to find it....

@javafanboy javafanboy added the enhancement New feature or request label Feb 23, 2023
@aseovic
Copy link
Member

aseovic commented Feb 23, 2023

It's actually 0.80 (see OldCache.DEFAULT_PRUNE), but that's beyond the point.

Unfortunately, there is no way to change the default atm, but we could easily introduce a system property that would allow you to change it for all the caches. If you want to have different default for different caches, that may be doable as well, but it would be a bit more complicated.

The former can be easily accomplished by changing

    public static final double DEFAULT_PRUNE = 0.80;

to

    public static final double DEFAULT_PRUNE  = Config.getDouble("coherence.local.cache.default.prune", 0.80);

The latter would require that we allow a double/percentage to be specified for the <low-units> in addition to the explicit memory size, and use it to change the prune level for that particular cache.

I guess both improvements make sense: the first one would allow you to change the default, the second to set low units based on high units percentage for a specific cache. I'll create a few enhancement requests, thanks for pointing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants