:right-sidebar: True MemoryPressureSettings =================================================================== .. currentmodule:: gi.repository.WebKit .. versionadded:: 2.34 .. class:: MemoryPressureSettings(**kwargs) :no-contents-entry: :Constructors: :: new() -> WebKit.MemoryPressureSettings Constructors ------------ .. rst-class:: interim-class .. class:: MemoryPressureSettings :no-index: .. classmethod:: new() -> ~gi.repository.WebKit.MemoryPressureSettings Create a new :obj:`~gi.repository.WebKit.MemoryPressureSettings` with the default values. .. versionadded:: 2.34 Methods ------- .. rst-class:: interim-class .. class:: MemoryPressureSettings :no-index: .. method:: free() -> None Free the :obj:`~gi.repository.WebKit.MemoryPressureSettings`. .. versionadded:: 2.34 .. method:: get_conservative_threshold() -> float Gets the conservative memory usage threshold. .. versionadded:: 2.34 .. method:: get_kill_threshold() -> float Gets the kill memory usage threshold. .. versionadded:: 2.34 .. method:: get_memory_limit() -> int Gets the memory usage limit. .. versionadded:: 2.34 .. method:: get_poll_interval() -> float Gets the interval at which memory usage is checked. .. versionadded:: 2.34 .. method:: get_strict_threshold() -> float Gets the strict memory usage threshold. .. versionadded:: 2.34 .. method:: set_conservative_threshold(value: float) -> None Sets the memory limit for the conservative policy to start working. Sets ``value`` as the fraction of the defined memory limit where the conservative policy starts working. This policy will try to reduce the memory footprint by releasing non critical memory. The threshold must be bigger than 0 and smaller than 1, and it must be smaller than the strict threshold defined in ``settings``. The default value is 0.33. .. versionadded:: 2.34 :param value: fraction of the memory limit where the conservative policy starts working. .. method:: set_kill_threshold(value: float) -> None Sets ``value`` as the fraction of the defined memory limit where the process will be killed. The threshold must be a value bigger or equal to 0. A value of 0 means that the process is never killed. If the threshold is not 0, then it must be bigger than the strict threshold defined in ``settings``. The threshold can also have values bigger than 1. The default value is 0. .. versionadded:: 2.34 :param value: fraction of the memory limit where the process will be killed because of excessive memory usage. .. method:: set_memory_limit(memory_limit: int) -> None Sets ``memory_limit`` the memory limit value to ``settings``. The default value is the system's RAM size with a maximum of 3GB. .. versionadded:: 2.34 :param memory_limit: amount of memory (in MB) that the process is allowed to use. .. method:: set_poll_interval(value: float) -> None Sets ``value`` as the poll interval used by ``settings``. The poll interval value must be bigger than 0. The default value is 30 seconds. .. versionadded:: 2.34 :param value: period (in seconds) between memory usage measurements. .. method:: set_strict_threshold(value: float) -> None Sets the memory limit for the strict policy to start working. Sets ``value`` as the fraction of the defined memory limit where the strict policy starts working. This policy will try to reduce the memory footprint by releasing critical memory. The threshold must be bigger than 0 and smaller than 1. Also, it must be bigger than the conservative threshold defined in ``settings``, and smaller than the kill threshold if the latter is not 0. The default value is 0.5. .. versionadded:: 2.34 :param value: fraction of the memory limit where the strict policy starts working.