Monitor system memory usage level in apps
Description
If the system is running low on memory, it will signal to userspace that it’s running low on memory before it has to start killing random apps due to being out of memory. On receiving this signal, apps should free memory which they don’t strictly/currently need, in order to free up system resources overall and hopefully avoid having to use the OOM killer to kill arbitrary processes. Killing arbitrary processes is potentially very disruptive to the user, so should be avoided if possible.
Goals
- Identify large memory uses in the app
- Free them when the
Gio.MemoryMonitor.low-memory-warning
signal is received - Notify the user in the UI in an appropriate way (if needed)
Scope
- Core apps
- Circle apps
- Development tools
People on charge & contact
Instructions to achieve the goals
- Identify large uses of memory in the app. For example: caches, open (and not memory-mapped) files, closed windows and their widget trees. The
Gio.MemoryMonitor
documentation has more suggestions. - Listen to the
Gio.MemoryMonitor.low-memory-warning
signal. Free the memory when it’s received. - If freeing the memory will significantly or noticeably impact on the user experience (which it probably shouldn’t), consider showing a toast (or some other form of feedback) in the UI to notify the user. This step will probably not be necessary, since freeing memory should normally only slow the app down a small amount for a brief period.
Label for tracking the initiative
Initiative: Low memory monitoring
This should be used only for issues/MRs directly related to monitoring low-memory status in apps. It should not be used for labelling other memory usage optimisations in apps.
Text for the initiative issue in projects
If the system is running low on memory, it will signal to userspace that it’s running low on memory before it has to start killing random apps due to being out of memory. On receiving this signal, apps should free memory which they don’t strictly/currently need, in order to free up system resources overall and hopefully avoid having to use the OOM killer to kill arbitrary processes. Killing arbitrary processes is potentially very disruptive to the user, so should be avoided if possible.
- Identify large memory uses in the app
- Free them when the
Gio.MemoryMonitor.low-memory-warning
signal is received- Notify the user in the UI in an appropriate way (if needed)
List of projects & tasks
Core Apps
-
Calculator -
Calendar -
Characters -
Cheese -
Clocks -
Connections -
Console -
Contacts -
Disk Usage Analyzer -
Disks -
Document Scanner -
Document Viewer -
Extensions -
Files -
Fonts -
Help -
Image Viewer -
Logs -
Maps -
Music -
Photos -
Settings -
Software -
System Monitor -
Text Editor -
Tour -
Videos -
Weather -
Web: WebKit has its own memory pressure monitors and drops various caches when appropriate
Circle Apps
-
Amberol -
Apostrophe -
Audio Sharing -
Authenticator -
Blanket -
Boatswain -
Cartridges -
Chess Clock -
Citations -
Clairvoyant -
Collision -
Commit -
Cozy -
Curtail -
Decoder -
Déjà Dup Backups -
Dialect -
Drawing -
Elastic -
Emblem -
Eyedropper -
File Shredder -
Font Downloader -
Fragments -
Gaphor -
Health -
Identity -
Junction -
Khronos -
Komikku -
Kooha -
Lorem -
Metadata Cleaner -
Metronome -
Mousai -
NewsFlash -
Obfuscate -
Pika Backup -
Plots -
Podcasts -
Polari -
Secrets -
Share Preview -
Shortwave -
Solanum -
Tangram -
Telegraph -
Text Pieces -
Video Trimmer -
Warp -
Webfont Kit Generator -
Wike -
Workbench -
Zap
Development Tools
-
App Icon Preview -
Boxes -
Builder -
Color Palette -
Contrast -
D-Spy -
Dconf Editor -
Devhelp -
Icon Library -
Symbolic Preview -
Sysprof -
Typography
How can I help
- Pick an app, analyse its memory usage, and suggest how it could be reduced
- If the app already pays attention to
low-memory-warning
, or there are no obvious ways to reduce memory usage, mark the app as done in the list above and add a comment pointing to the existing implementation or saying that there are no obvious improvements which can be made - Implement those changes once the app maintainer has agreed