Comment 2 for bug 1840483

Revision history for this message
Dan Watkins (oddbloke) wrote : Re: Extremely high memory usage by barriers (possible leak?)

OK, so I've tracked memory usage using this barebones shell one-liner:

while true; do echo $(date) $(ps aux | grep bin/barriers | grep -v grep); sleep 60; done | tee -a ~/barriers.ps

The first few entries look fine; RSS doesn't change (to save you working it out without the ps headers, it's the 9228 number here):

Fri Aug 16 12:17:38 EDT 2019 daniel 15785 2.0 0.0 111528 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
TRAPWINCH:zle:2: widgets can only be called when ZLE is active
Fri Aug 16 12:18:38 EDT 2019 daniel 15785 0.1 0.0 111528 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:19:38 EDT 2019 daniel 15785 0.1 0.0 111528 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:20:38 EDT 2019 daniel 15785 0.1 0.0 111528 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:21:38 EDT 2019 daniel 15785 0.1 0.0 111692 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:22:38 EDT 2019 daniel 15785 0.2 0.0 111692 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:23:38 EDT 2019 daniel 15785 0.2 0.0 111692 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:24:38 EDT 2019 daniel 15785 0.2 0.0 111692 9228 ? Sl 12:17 0:00 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:25:38 EDT 2019 daniel 15785 0.2 0.0 111692 9228 ? Sl 12:17 0:01 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:26:38 EDT 2019 daniel 15785 0.2 0.0 111692 9228 ? Sl 12:17 0:01 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800

However, when I enable the duplicate client (I have two user sessions on my client screen, if you're wondering), things go sideways fast:

Fri Aug 16 12:27:38 EDT 2019 daniel 15785 0.2 0.0 112072 11432 ? Sl 12:17 0:01 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:28:38 EDT 2019 daniel 15785 0.3 0.0 112576 13516 ? Sl 12:17 0:02 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:29:38 EDT 2019 daniel 15785 0.3 0.0 113200 15728 ? Sl 12:17 0:02 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800

That's an extra 6MB of memory used over 3 minutes. When I turn the duplicate client back off, we see some growth in the first line (as the duplicate client was still enabled for part of that minute), but after that the growth stops:

Fri Aug 16 12:30:38 EDT 2019 daniel 15785 0.3 0.1 113572 17156 ? Sl 12:17 0:02 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:31:38 EDT 2019 daniel 15785 0.3 0.1 113572 17156 ? Sl 12:17 0:02 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:32:38 EDT 2019 daniel 15785 0.3 0.1 113572 17156 ? Sl 12:17 0:03 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800
Fri Aug 16 12:33:38 EDT 2019 daniel 15785 0.3 0.1 113572 17156 ? Sl 12:17 0:03 /usr/bin/barriers -f --no-tray --debug INFO --name surprise --enable-crypto -c /tmp/Barrier.lHYHCL --address :24800

So it seems pretty clear to me that this is a leak because of the duplicate clients.