3.9 <WebKitMemoryPressureSettings>

Structure: <WebKitMemoryPressureSettings>

A boxed type representing the settings for the memory pressure handler

<WebKitMemoryPressureSettings> 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 <WebKitMemoryPressureSettings> can be passed to a <WebKitWebContext> constructor, and the settings will be applied to all the web processes created by that context.

A <WebKitMemoryPressureSettings> 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 <WebKitWebsiteDataManager>.

Procedures

Method: memory-pressure-settings:copy self ⇒ %return
Method: copy self ⇒ %return

Make a copy of self.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

%return

Returned: a <WebKitMemoryPressureSettings>.

A copy of of the passed <WebKitMemoryPressureSettings>.

Method: memory-pressure-settings:free self
Method: free self

Free the <WebKitMemoryPressureSettings>.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

Method: memory-pressure-settings:get-conservative-threshold self ⇒ %return
Method: get-conservative-threshold self ⇒ %return

Gets the conservative memory usage threshold.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

%return

Returned: a real number.

value in the (0, 1) range.

Method: memory-pressure-settings:get-kill-threshold self ⇒ %return
Method: get-kill-threshold self ⇒ %return

Gets the kill memory usage threshold.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

%return

Returned: a real number.

positive value, can be zero.

Method: memory-pressure-settings:get-memory-limit self ⇒ %return
Method: get-memory-limit self ⇒ %return

Gets the memory usage limit.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

%return

Returned: an unsigned 32-bit integer.

current value, in megabytes.

Method: memory-pressure-settings:get-poll-interval self ⇒ %return
Method: get-poll-interval self ⇒ %return

Gets the interval at which memory usage is checked.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

%return

Returned: a real number.

current interval value, in seconds.

Method: memory-pressure-settings:get-strict-threshold self ⇒ %return
Method: get-strict-threshold self ⇒ %return

Gets the strict memory usage threshold.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

%return

Returned: a real number.

value in the (0, 1) range.

Procedure: memory-pressure-settings:new ⇒ %return

Create a new <WebKitMemoryPressureSettings> with the default values.

%return

Returned: a <WebKitMemoryPressureSettings>.

A new <WebKitMemoryPressureSettings> instance filled with the default values.

Method: memory-pressure-settings:set-conservative-threshold self value
Method: set-conservative-threshold self value

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 self. The default value is 0.33.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

value

Passed: a real number.

fraction of the memory limit where the conservative policy starts working.

Method: memory-pressure-settings:set-kill-threshold self value
Method: set-kill-threshold self value

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 self. The threshold can also have values bigger than 1. The default value is 0.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

value

Passed: a real number.

fraction of the memory limit where the process will be killed because of excessive memory usage.

Method: memory-pressure-settings:set-memory-limit self memory-limit
Method: set-memory-limit self memory-limit

Sets memory-limit the memory limit value to self.

The default value is the system’s RAM size with a maximum of 3GB.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

memory-limit

Passed: an unsigned 32-bit integer.

amount of memory (in MB) that the process is allowed to use.

Method: memory-pressure-settings:set-poll-interval self value
Method: set-poll-interval self value

Sets value as the poll interval used by self.

The poll interval value must be bigger than 0. The default value is 30 seconds.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

value

Passed: a real number.

period (in seconds) between memory usage measurements.

Method: memory-pressure-settings:set-strict-threshold self value
Method: set-strict-threshold self value

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 self, and smaller than the kill threshold if the latter is not 0. The default value is 0.5.

self

Passed: a <WebKitMemoryPressureSettings>.

a <WebKitMemoryPressureSettings>

value

Passed: a real number.

fraction of the memory limit where the strict policy starts working.