Re: pipewire memory usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There was a leak in 0.3.40 that could explain this, see https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1840

Upcoming 0.3.41 will have this fixed. At least I can't reproduce this anymore with the test you posted below.

Wim

On Sun, Dec 12, 2021 at 12:49 PM Dominique Martinet <asmadeus@xxxxxxxxxxxxx> wrote:
Fabio Valentini wrote on Sun, Dec 12, 2021 at 12:25:11PM +0100:
> > on my laptop, /usr/bin/pipewire uses 56M RSS, 5M SHR,
> > but    /usr/bin/pipewire-pulse uses 347M RSS, 4M SHR.
> > 56M is okeyish, but 347M seems a lot. I think firefox is going
> > through pipewire-pulse, so that interface might be getting more use
> > than native pipewire. But what are the expected values for this?
>
> That certainly seems high to me. On my system I see values like
> - pipewire: resident memory ~18M, shared memory ~8M
> - pipewire-pulse: redident memory ~19M, shared memory ~6M
> even while playing audio from firefox, for example.
>
> Where did you get those RSS values?
> I checked in gnome-system-monitor and with ps -aux, and both reported
> the same values for resident memory (RSS).

To add another datapoint I also have always seen pretty high RSS usage
from pipewire-pulse:

$ ps aux|grep pipewire
myuser   14645  0.5  0.4 198772 79100 ?        Ssl  Dec07  38:08 /usr/bin/pipewire
myuser   14646  0.6  3.4 713516 555756 ?       SLsl Dec07  45:29 /usr/bin/pipewire-pulse
myuser   14652  0.0  0.0  38112 12228 ?        Sl   Dec07   0:04 /usr/bin/pipewire-media-session

(so 555MB RSS)


I've also noticed that the background cpu% usage seems to increase, so
I'd say the memory is still reachable somewhere and there must be some
list getting big and skimmed through from time to time; restarting the
pipewire processes when I start seeing them climb too high in htop makes
them behave again...


... Okay, so there's an obvious leak when pulse clients connect and
leave on pipewire-0.3.40-1.fc34.x86_64, about 3MB per client (!).


I've just pkill pipewire to restart it:
asmadeus  293661  0.5  0.0  31612  7276 ?        S<sl 20:40   0:00 /usr/bin/pipewire-pulse
asmadeus  293675  1.5  0.0  56092 11488 ?        S<sl 20:40   0:00 /usr/bin/pipewire
asmadeus  293678  5.0  0.0  37528 12364 ?        S<l  20:40   0:00 /usr/bin/pipewire-media-session

then ran mpv in a tight loop, 100 times:
for i in {1..100}; do mpv somefile.opus -length 1 & done; wait
(pulseaudio output)

and rss climbed to 313MB:
asmadeus  293661  2.6  1.9 689228 313832 ?       S<sl 20:40   0:01 /usr/bin/pipewire-pulse
asmadeus  293675  1.8  0.4 188392 76844 ?        S<sl 20:40   0:01 /usr/bin/pipewire
asmadeus  293678  0.5  0.0  38168 12672 ?        S<l  20:40   0:00 /usr/bin/pipewire-media-session

another 100 times brings it up to 652'672.

I had noticed that firefox likes to create new output streams and closes
them everytime there's a video, even if sound is muted, so I'd think
that on some sites it would behave quite similarly to that.


I've uploaded pw-dump after this if that's any help:
https://gaia.codewreck.org/local/tmp/pw-dump

But it should be easy to reproduce, I don't think I have anything
too specific sound-wise here...


Happy to open an issue upstream if there isn't one yet, I haven't had a
look. Trying to reproduce on master would likely be first.
Please let me know if you take over or I'll look into it further over
the next few days...
--
Dominique Martinet | Asmadeus
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux