Project

General

Profile

Bug #8957

tmux memory consumption (leak?)

Added by Ben Franck almost 2 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
OI-Userland
Target version:
-
Start date:
2018-01-09
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Good morning,
I've been suspecting this for a while because after a while I get laggy interaction through tmux so I checked the memory and was surprised to see the memory consumption was on par with Firefox (?!?!?). Restarting tmux clears out the lag.
So I started a fresh instance and wrote down the memory usage over time :

ben@oldstar:~$ \ps -o pid,ppid,pcpu,rss,vsz,etime,args -p 4242,4245
  PID  PPID %CPU  RSS  VSZ     ELAPSED COMMAND
 4242  1820  0.0 2632 4592       13:25 tmux
 4245     1  0.1 4016 6568       13:25 tmux
ben@oldstar:~$ \ps -o pid,ppid,pcpu,rss,vsz,etime,args -p 4242,4245
  PID  PPID %CPU  RSS  VSZ     ELAPSED COMMAND
 4242  1820  0.0 2632 4592    01:26:28 tmux
 4245     1  0.1 6596 9144    01:26:28 tmux
ben@oldstar:~$ \ps -o pid,ppid,pcpu,rss,vsz,etime,args -p 4242,4245
  PID  PPID %CPU  RSS  VSZ     ELAPSED COMMAND
 4242  1820  0.0 2632 4592  3-01:03:25 tmux
 4245     1  0.9 146964 149512  3-01:03:25 tmux
ben@oldstar:~$ \ps -o pid,ppid,pcpu,rss,vsz,etime,args -p 4242,4245
  PID  PPID %CPU  RSS  VSZ     ELAPSED COMMAND
 4242  1820  0.0 2632 4592  3-04:00:36 tmux
 4245     1  0.9 152628 155176  3-04:00:36 tmux
ben@oldstar:~$ \ps -o pid,ppid,pcpu,rss,vsz,etime,args -p 4242,4245
  PID  PPID %CPU  RSS  VSZ     ELAPSED COMMAND
 4242  1820  0.0 2632 4592  3-23:12:56 tmux
 4245     1  1.2 190076 192616  3-23:12:56 tmux
ben@oldstar:~$ \ps -o pid,ppid,pcpu,rss,vsz,etime,args -p 4242,4245
  PID  PPID %CPU  RSS  VSZ     ELAPSED COMMAND
 4242  1820  0.0 2632 4592  4-23:34:44 tmux
 4245     1  1.4 237612 240152  4-23:34:44 tmux

Activity inside tmux consist at using the created terminal (mostly elinks), not creating pane, windows, shuffling things around, etc...
As you can see after 4 days, tmux is using nearly 250MB of memory, I'll let you imagine what happens after 1 month.

This is a recent Hipster version (update from 13/12/2017) and I noticed the lag (symptom of tmux using as lot of memory) a few month ago :

ben@oldstar:~$ uname -a
SunOS oldstar 5.11 illumos-84fe1120bd i86pc i386 i86pc Solaris

Best regards.
Ben

History

#1

Updated by Ben Franck almost 2 years ago

Just an update after 21 days on the same tmux session :

ben@oldstar:~$ \ps -o pid,ppid,pcpu,rss,vsz,etime,args -p 4242,4245
  PID  PPID %CPU  RSS  VSZ     ELAPSED COMMAND
 4245     1  5.2 986620 990824 21-00:51:28 tmux

As you can see it uses 5% of CPU without any activity in the terminals and input and output started to lag.

Best regards.
Ben

Also available in: Atom PDF