Skip to content

Large lingering mmaps that apparently could be paged out seem to instead cause large memory crashes #318

@ell1e

Description

@ell1e

I'm using a chat client called nheko which uses a lot of memory during the initial log in. However, usually later it uses less memory during normal use. Yet, after one of those log ins, many minutes later I got this out of memory "crash":

Jun  6 14:32:30 pinephone daemon.info earlyoom: mem avail:   203 of  2994 MiB ( 6.78%), swap free:  255 of 1023 MiB (24.95%)
Jun  6 14:32:30 pinephone daemon.info earlyoom: low memory! at or below SIGTERM limits: mem 10.00%, swap 25.00%
Jun  6 14:32:30 pinephone daemon.info earlyoom: sending SIGTERM to process 7440 uid 10000 "io.github.Nheko": badness 1036, VmRSS 1839 MiB
Jun  6 14:32:30 pinephone daemon.info earlyoom: process exited after 0.0 seconds

I asked the developer of Nheko what happened, and whether this is a Nheko memory leak. Especially since after restarting it used less memory again, only around 200mb which is about 10% of what it used when killed.

The nheko developer suggested the issue was a combination of 1. nheko memory maps a large amount of areas but then mostly doesn't use them anymore after that login phase, 2. those memory pages could then be paged out but the kernel doesn't seem to do that eagerly unless memory is tighter than the earlyoom trigger point, 3. earlyoom instead of just doing something to get those pages paged out will seemingly needlessly terminate nheko instead.

(I hope I summed all of that up correctly, my apologies if not.)

Is this fixable in earlyoom? This seems like a quite fundamental issue that will cause unnecessary crashes for apps that use memory mapping extensively.

Affected earlyoom version: earlyoom v1.7, as packaged by postmarketOS 23.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions