Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A boxed type representing the settings for the memory pressure handler
MemoryPressureSettings
is a boxed type that can be used to provide some custom settings
to control how the memory pressure situations are handled by the different processes.
The memory pressure system implemented inside the different process will try to keep the memory usage under the defined memory limit. In order to do that, it will check the used memory with a user defined frequency and decide whether it should try to release memory. The thresholds passed will define how urgent is to release that memory.
Take into account that badly defined parameters can greatly reduce the performance of the engine. For example, setting memory limit too low with a fast poll interval can cause the process to constantly be trying to release memory.
A MemoryPressureSettings
can be passed to a WebContext
constructor, and the settings will
be applied to all the web processes created by that context.
A MemoryPressureSettings
can be passed to webkit_website_data_manager_set_memory_pressure_settings()
,
and the settings will be applied to all the network processes created after that call by any instance of
WebsiteDataManager
.
Since: 2.34
Synopsis
- newtype MemoryPressureSettings = MemoryPressureSettings (ManagedPtr MemoryPressureSettings)
- memoryPressureSettingsCopy :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> m MemoryPressureSettings
- memoryPressureSettingsFree :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> m ()
- memoryPressureSettingsGetConservativeThreshold :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> m Double
- memoryPressureSettingsGetKillThreshold :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> m Double
- memoryPressureSettingsGetMemoryLimit :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> m Word32
- memoryPressureSettingsGetPollInterval :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> m Double
- memoryPressureSettingsGetStrictThreshold :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> m Double
- memoryPressureSettingsNew :: (HasCallStack, MonadIO m) => m MemoryPressureSettings
- memoryPressureSettingsSetConservativeThreshold :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> Double -> m ()
- memoryPressureSettingsSetKillThreshold :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> Double -> m ()
- memoryPressureSettingsSetMemoryLimit :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> Word32 -> m ()
- memoryPressureSettingsSetPollInterval :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> Double -> m ()
- memoryPressureSettingsSetStrictThreshold :: (HasCallStack, MonadIO m) => MemoryPressureSettings -> Double -> m ()
Exported types
newtype MemoryPressureSettings Source #
Memory-managed wrapper type.
MemoryPressureSettings (ManagedPtr MemoryPressureSettings) |
Instances
Eq MemoryPressureSettings Source # | |
Defined in GI.WebKit.Structs.MemoryPressureSettings | |
GBoxed MemoryPressureSettings Source # | |
Defined in GI.WebKit.Structs.MemoryPressureSettings | |
ManagedPtrNewtype MemoryPressureSettings Source # | |
Defined in GI.WebKit.Structs.MemoryPressureSettings toManagedPtr :: MemoryPressureSettings -> ManagedPtr MemoryPressureSettings | |
TypedObject MemoryPressureSettings Source # | |
Defined in GI.WebKit.Structs.MemoryPressureSettings | |
HasParentTypes MemoryPressureSettings Source # | |
Defined in GI.WebKit.Structs.MemoryPressureSettings | |
IsGValue (Maybe MemoryPressureSettings) Source # | Convert |
Defined in GI.WebKit.Structs.MemoryPressureSettings gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe MemoryPressureSettings -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe MemoryPressureSettings) | |
type ParentTypes MemoryPressureSettings Source # | |
Defined in GI.WebKit.Structs.MemoryPressureSettings |
Methods
Click to display all available methods, including inherited ones
copy
memoryPressureSettingsCopy Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> m MemoryPressureSettings | Returns: A copy of of the passed |
Make a copy of settings
.
Since: 2.34
free
memoryPressureSettingsFree Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> m () |
Free the MemoryPressureSettings
.
Since: 2.34
getConservativeThreshold
memoryPressureSettingsGetConservativeThreshold Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> m Double | Returns: value in the |
Gets the conservative memory usage threshold.
Since: 2.34
getKillThreshold
memoryPressureSettingsGetKillThreshold Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> m Double | Returns: positive value, can be zero. |
Gets the kill memory usage threshold.
Since: 2.34
getMemoryLimit
memoryPressureSettingsGetMemoryLimit Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> m Word32 | Returns: current value, in megabytes. |
Gets the memory usage limit.
Since: 2.34
getPollInterval
memoryPressureSettingsGetPollInterval Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> m Double | Returns: current interval value, in seconds. |
Gets the interval at which memory usage is checked.
Since: 2.34
getStrictThreshold
memoryPressureSettingsGetStrictThreshold Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> m Double | Returns: value in the |
Gets the strict memory usage threshold.
Since: 2.34
new
memoryPressureSettingsNew Source #
:: (HasCallStack, MonadIO m) | |
=> m MemoryPressureSettings | Returns: A new |
Create a new MemoryPressureSettings
with the default values.
Since: 2.34
setConservativeThreshold
memoryPressureSettingsSetConservativeThreshold Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> Double |
|
-> m () |
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.
Since: 2.34
setKillThreshold
memoryPressureSettingsSetKillThreshold Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> Double |
|
-> m () |
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.
Since: 2.34
setMemoryLimit
memoryPressureSettingsSetMemoryLimit Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> Word32 |
|
-> m () |
Sets memoryLimit
the memory limit value to settings
.
The default value is the system's RAM size with a maximum of 3GB.
Since: 2.34
setPollInterval
memoryPressureSettingsSetPollInterval Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> Double |
|
-> m () |
Sets value
as the poll interval used by settings
.
The poll interval value must be bigger than 0. The default value is 30 seconds.
Since: 2.34
setStrictThreshold
memoryPressureSettingsSetStrictThreshold Source #
:: (HasCallStack, MonadIO m) | |
=> MemoryPressureSettings |
|
-> Double |
|
-> m () |
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.
Since: 2.34