Page MenuHomePhabricator

Investigate a possible memory leak in userOptions.php
Open, Needs TriagePublic

Assigned To
None
Authored By
Urbanecm_WMF
Jan 17 2024, 3:31 PM
Referenced Files
F41695681: image.png
Jan 17 2024, 3:31 PM
F41695679: image.png
Jan 17 2024, 3:31 PM

Description

As part of performing T353225: Echo: Make use of conditional user defaults in the beta cluster, I managed to get deployment-mwmaint02 into an OoM state, resulting in the server becoming unusable (until it got rebooted). Based on RAM usage chart and htop output, I am fairly certain this is happening because userOptions.php contains a memory leak, see screenshots:

image.png (3,310×1,676 px, 271 KB)
image.png (3,456×772 px, 1 MB)

Eventually, the userOptions.php execution has eaten over half of the available memory.

Event Timeline

@Tgr mentioned caching user options as a possible culprit here. Recording that though here, so it doesn't get lost.

At a glance I would guess the issue is data in UserOptionsManager::$optionsFromDb never getting unset. Which probably leads to all kinds of bugs too, if you save user options changes multiple times in the same request.