omero.install.jvmcfg module

Automatic configuration of memory settings for Java servers.

class install.jvmcfg.ManualStrategy(name, settings=None)[source]

Bases: Strategy

Simplest strategy which assumes all values have been set and simply uses them or their defaults.

class install.jvmcfg.PercentStrategy(name, settings=None)[source]

Bases: Strategy

Strategy based on a percent of available memory.

PERCENT_DEFAULTS = (('blitz', 15), ('pixeldata', 15), ('indexer', 10), ('repository', 10), ('other', 1))
calculate_heap_size(method=None)[source]

Re-calculates the appropriate heap size based on the value of get_percent(). The “active” memory returned by method() will be used by default, but can be modified to use “total” via the “use_active” flag.

get_heap_size()[source]

Uses the results of the default settings of calculate_heap_size() as an argument to get_heap_size(), in other words some percent of the active memory.

get_percent()[source]
get_perm_gen()[source]
usage_table(min=10, max=20)[source]
class install.jvmcfg.Settings(server_values=None, global_values=None)[source]

Bases: object

Container for the config options found in etc/grid/config.xml

get_strategy()[source]
lookup(key, default=None)[source]
overwrite(key, value, always=False)[source]
was_set(key)[source]
class install.jvmcfg.Strategy(name, settings=None)[source]

Bases: object

Strategy for calculating memory settings. Primary class of the memory module.

get_append()[source]
get_heap_dump()[source]
get_heap_size(sz=None)[source]
get_memory_settings()[source]
get_perm_gen()[source]
system_memory_mb()[source]

Returns a tuple, in MB, of available, active, and total memory.

“total” memory is found by calling to first a Python library (if installed) and otherwise a Java class. If “system_memory” is set, it will short-circuit both methods.

“active” memory is set to “total” but limited by “min_system_memory” and “max_system_memory”.

“available” may not be accurate, and in some cases will be set to total.

class install.jvmcfg.StrategyRegistry(*args, **kwargs)[source]

Bases: dict

install.jvmcfg.adjust_settings(config, template_xml, blitz=None, indexer=None, pixeldata=None, repository=None)[source]

Takes an omero.config.ConfigXml object and adjusts the memory settings. Primary entry point to the memory module.

install.jvmcfg.read_settings(template_xml)[source]

Read the memory settings from the template file

install.jvmcfg.strip_dict(map, prefix=('omero', 'jvmcfg'), suffix=(), limit=1)[source]

For the given dictionary, return a copy of the dictionary where all entries not matching the prefix, suffix, and limit have been removed and where all remaining keys have had the prefix and suffix stripped. The limit describes the number of elements that are allowed in the new key after stripping prefix and suffix.

install.jvmcfg.usage_charts(path, min=0, max=20, Strategy=<class 'install.jvmcfg.PercentStrategy'>, name='blitz')[source]