-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
wxGUI/preferences: allow the user set maximum memory to be used by modules #3307
wxGUI/preferences: allow the user set maximum memory to be used by modules #3307
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not use psutil, it's another external dependency. Since MEMORYMB is by default not set, I would leave it unset, probably need to use TextCtrl instead of SpinCtrl.
The same could be done for NPROCS variable.
What I am not sure is whether these variables are actually respected by the tools.
There is no other cross-platform way to find out the total RAM size of a user machine. #3267 It would be convenient if the default minimum could be set globally more easily in the wxGUI preferences environment to match the capacity of a user's workstation rather than having to set it individually in every module.
Could you explain why to use the TextCtrl widget, please? |
Without setting gis env grass/lib/gis/parser_standard_options.c Lines 252 to 267 in 2841c5f
|
These MEMORYMB and NPROCS are gisenv variables, so it seems to me that a analysis is needed to determine how the GUI setting should interact with switching mapsets and turning GRASS GIS on and off. Notably, the settings is already managed by the MEMORYMB variable, so why to involve GUI setting file? Maybe, this is supposed to be completely different from the GUI settings or at least separate from implementation perspective but perhaps as a tab in the setting dialog (just thinking out-loud here). Maybe, g.gisenv just needs a wrapper. The default for in the individual tools when MEMORYDB is not set is already there - it is 300. |
This mixes two things together, setting the default globally and setting it to match the capacity. I am not in favor of the latter, e.g. I have rarely the full capacity (or 5/6 of it) available, and it's not worth adding a new dependency.
Sorry, I was too brief, my suggestion was to use TextCtrl, which allows you (unlike SpinCtrl) to have no value set. So by default MEMORYMB is not set, so initially the TextCtrl would be empty. SpinCtrl is not useful for input of large numbers anyway I think. We could include integer validator in the TextCtrl I suppose. |
We could remove this from the settings file and just keep it in the settings GUI, it would be dynamically read from the MEMORYMB variable when you open settings, but it won't be recorded in the json file. When switching mapsets, the variable seem to persist, so this looks ok to me.
|
…ed by modules" This reverts commit 6f45045.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
… be used by supported tools (OSGeo#3307)
Closes #3267.
Solution require Python psutil lib to be installed.The global memory size in MB used by modules is calculated using the formulatotal_memory - (1 / 6 * total_memory)
wxgui_preferences_add_max_module_memory_settings.mp4