Expose memory pressure notifications

Bug #1267132 reported by Olivier Tilloy
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Oxide
Triaged
High
Santosh

Bug Description

Not really sure how that works, but it seems chromium has a mechanism to notify of memory pressure situations (see https://code.google.com/p/chromium/codesearch#chromium/src/base/memory/memory_pressure_listener.h), we might want to expose it somehow, to allow applications to free up memory when under heavy memory pressure.

Olivier Tilloy (osomon)
description: updated
Changed in oxide:
importance: Undecided → Wishlist
status: New → Triaged
Changed in oxide:
importance: Wishlist → High
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

I've been looking at implementing this, but linux doesn't have a supported API for applications to receive memory pressure notifications. It looks like WebKit did do something using memcg (https://bugs.webkit.org/show_bug.cgi?id=123532), but:

- This requires a 3.10 kernel, something that the phone doesn't have.
- It doesn't work on Ubuntu desktop either because applications can't open memory.pressure_level:

---------- 1 root root 0 Sep 23 12:41 /sys/fs/cgroup/memory/memory.pressure_level

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

I notice in https://code.google.com/p/chromium/codesearch#chromium/src/base/memory/shared_memory_android.cc that it uses Android's shared memory manager in the kernel rather than providing a memory pressure handler. Since we have this in our kernel (as far as I know) should we be using it?

Revision history for this message
carloslp (carloslp) wrote :

FYI: WebKit developers are discussing alternative implementations not based on cgroups here https://bugs.webkit.org/show_bug.cgi?id=155255

Revision history for this message
Olivier Tilloy (osomon) wrote :

> This requires a 3.10 kernel, something that the phone doesn't have.

 - Krillin (BQ Aquaris E4.5) has a 3.4.67 kernel
 - Arale (Meizu MX4) has a 3.10.35+ kernel
 - Frieza (BQ Aquaris M10) has a 3.10.93+ kernel

On those devices that have a kernel >= 3.10, it doesn’t look like memory cgroups are enabled though (I’m not seeing any /sys/fs/cgroup/memory entry).

The alternative approach pointed to by carloslp is basically regularly polling /proc/meminfo. We are already doing something similar in webbrowser-app, I wonder whether that mechanism should be moved to oxide?

David Barth (dbarth)
Changed in oxide:
assignee: nobody → Santosh (santoshbit2007)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.