New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 773111 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

better low-memory notification

Project Member Reported by semenzato@chromium.org, Oct 9 2017

Issue description

On most systems, the low-memory notification signal to Chrome is a simple function of the values of "easily reclaimable" RAM (ER-RAM) and free swap space.  On some systems---specifically caroline---we changed this to ignore swap space (i.e. we use a simple threshold for the value of ER-RAM) and for good reasons we're leaning to moving all systems to this direction.

These approaches are simple and appear to work reasonably well, and, because the behavior of the kernel memory manager is somewhat chaotic (i.e. it appears to drastically change behavior in unpredictable spurts), it may well be the best we can do, or close enough.  But there are obvious issues.

1. Our preference for strongly minimizing kernel OOM kills forces us to choose a threshold that may be too conservative in most situations, except for the worst cases.

2. We have seen that the relative frequency of OOM kills varies considerably across platforms, so one-size-fits-all doesn't work too well.

For instance, with respect to issue #1, the current choice of a threshold for the ER-RAM does not consider that when swap space is available, during excess allocation pages are also swapped out at a similar rate, thus the free pool doesn't get exhausted as rapidly as when swap space is full and reclaim by swapping is no longer possible (*).  A mechanism that takes this into account may be more memory-efficient.  One such mechanism would still use a simple threshold for ER-RAM, but increase it as the swap space becomes full.

To evaluate such mechanisms we need better data, as described in issue 773110.

 
(*) the earlier notification level triggered when a function of available swap space and ER-RAM crossed a constant threshold:

<amount of ER-RAM> + (<available swap space> / <ram_vs_swap_weight>) LESS_THAN <threshold>

where <ram_vs_swap_weight> is a constant (usually 4).  But this doesn't work well because during fast allocation, the allocation rate may exceed the swap rate and cause OOM kills when swap space is still available (one could argue that this is a bug, but it's not an easy one to fix).  On caroline we have instead

<amount of ER-RAM> LESS_THAN <threshold>

This works better but completely ignores available swap space, which seems less than optimal, as discussed above.

A possible compromise would be to signal low memory when:

(
<available swap space> GREATER_THAN <er-ram-threshold> AND 
<amount of ER-RAM> LESS_THAN <er-ram-threshold>
)
OR
(
<available swap space> LESS_THAN <er-ram-threshold> AND
<amount of ER-RAM> LESS_THAN (<er-ram-threshold> * 2) - <available swap space>
)

(just as an example)

Status: Assigned (was: Untriaged)

Sign in to add a comment