Merged
Conversation
Fixes qupath#1946 (I hope)
Member
Author
|
@Rylern @alanocallaghan I've requested reviews mostly so you know about the changes - and especially the move to specifying a percentage rather than absolute value. It's a thoroughly miserable thing to write/check, since it requires making builds and constantly restarting QuPath. I'd like to just merge this - since it seems to be working well enough for me on both Windows and Mac. But it's certainly inelegant, anyway else is welcome to improve it :) |
Member
Author
|
If you want it test it locally, currently you'll need to run first until the runtime plugin is updated for gradle 9 compatibility. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1946 (I hope).
This also changes the max memory preference from requiring the memory to be defined in GB to instead using a percentage of available memory. I think this is easier to reason about, and also means we can constrain it to be between 10% and 90%.
This is a bit convoluted, because we need to try to read the current max memory from the config - since we can't rely upon the preference being correct. For example, having duplicate QuPath installations where they have the same (major/minor) version would result in them using the same preference key, but having different config files. The config files are what matters for setting the memory during launch. Another reason the preference might not match the reality is if the config file was edited externally.
There are still ways to thwart this, e.g. using a config file that specifies the max memory multiple times or in different ways (e.g. using
-Xmx) but I think that's tolerable.