Open Bug 1780058 Opened 2 years ago Updated 3 months ago

Tab unloading and memory pressure can fire spuriously on Linux due to ZFS caches

Categories

(Core :: Widget: Gtk, defect)

defect

Tracking

()

ASSIGNED

People

(Reporter: nika, Assigned: KrisWright)

References

Details

(Keywords: leave-open)

Attachments

(1 file)

A friend of mine noticed that tab unloading was occurring very frequently on their linux machine, despite there being plenty of actually free memory in use. It appears from their investigation that this may be caused by our logic for inspecting memory not taking ZFS in-memory disk caches into account when looking at the amount of free memory.

They linked https://github.com/hishamhm/htop/pull/976 to me which was a PR to htop to make it more aware of ZFS cache usage. We may be able to use something from this to avoid this issue.

Flags: needinfo?(kwright)

Looking at the telemetry for low-memory events fired in general on Linux and the impact of tab unloading, I'm more of the opinion that we should turn off tab unloading entirely for Linux.

Flags: needinfo?(kwright)
Assignee: nobody → kwright
Status: NEW → ASSIGNED

Adding leave-open as this patch only disables tab unloading on linux, and the problem still exists once it's landed.

Keywords: leave-open
Pushed by kwright@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bb26da139fb0
Turn off tab unloading on Linux. r=xpcom-reviewers,nika

To note, per the telemetry data spurious tab unloads are somewhat more likely on Linux than on other platforms. We ought to pref off tab unloading until we can improve this dataset using handling for caching and possibly some additional throttling to the frequency of unloaded tabs.

I also had spurious tab unloading with attached data loss issue (#1769006) but I don't have ZFS. I have btrfs (Linux Mint 20.4 and I didn't touch swappiness). Maybe these file systems are similar in some respects.

Summary: Tab unloading can fire spuriously on Linux due to ZFS caches → Tab unloading and memory pressure can fire spuriously on Linux due to ZFS caches

With tab unloading disabling, we could still be firing memory pressure events for the ZFS situation which could affect performance.

I think you should try to fix the ZFS cache handling instead of disabling tab unloading, also see https://bugzilla.mozilla.org/show_bug.cgi?id=1800335#c8 It's just too important on lower spec systems.

(Also maybe I should add from a historic perspective, it has been tiring as a user how often Firefox just downright disables tab unloading when it was there and seemingly working for at least SOME use cases before. If you're a user depending on this, having something essential so often just disabled is rather frustrating.)

Hello,

I add the feature work correctly for me on a machine with 3.23GB of RAM for OS use. I never found it killed active tabs and mostly worked as expected.
Currently I have out of memory crashes, since there is no way to manually unload tabs, just close them on the Task Manager. I found out the preference and turned it on but the tab unloading doesn't seem to work either way.
It just keeps going until there is no more memory and the OS basically halts from OoM.

I can provide data if needed but I have not noticed tabs unloading even if left there for many hours.

Thanks for the reports.

Until we have this re-enabled by default, setting browser.tabs.unloadOnLowMemory in about:config is one option.

Another is to use an extension. Unloading tabs is available in the extensions API and there are extensions that automatically unload tabs as well as some that add unloading it to the tab right-click menu.

There is some observability available for the tab unloading weighting system with about:unloads.

The leave-open keyword is there and there is no activity for 6 months.
:KrisWright, maybe it's time to close this bug?
For more information, please visit BugBot documentation.

Flags: needinfo?(kwright)
Flags: needinfo?(kwright)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: