+2
−0
+255
−0
Loading
This introduces a low memory watcher that dispatches an offthread read of /proc/meminfo every 5000/1000ms depending on memory levels, then determines which information to act on. It works like this: - Get a percentage of `MemAvailable` versus `MemTotal`. - If memory drops below 5% availability, we are in a memory pressure scenario - If `MemAvailable` is not large enough to accommodate a content process, we are in a memory pressure scenario - If we are in a memory pressure scenario, notify the observers from the main thread. The value I decided to use to represent a content process was based on observation and should be adjusted if it is not representative of what we consider a "typical" content process. Differential Revision: https://phabricator.services.mozilla.com/D117972