Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak, too many instances of the script started? #14

Open
NebuPookins opened this issue Apr 24, 2021 · 0 comments
Open

Memory leak, too many instances of the script started? #14

NebuPookins opened this issue Apr 24, 2021 · 0 comments

Comments

@NebuPookins
Copy link

After using tmux for a while (uptime 229 days), I started getting errors saying tmux has too many files open. The exact error message happens when I tried to create a new window via <prefix> c and the error is Create window failed: fork failed: Too many open files.

I used htop to investigate and it looks like many, many instance of the tmux-net-speed are running.

image

As you can see from this screnshot, I only have 10 windows open, but much more than 10 instances of the plugin running. Ideally, I'd expect 1 instance of the plugin running and its results shared across all of the windows, but even if it created one instance per window, I'd only expect to see 10 instances. But ps aux | grep tmux-net-speed | wc -l tells me there's 537 instances running.

If it helps, here's my ~/.tmux.conf file:

# Enabled plugins:
set -g @plugin 'tmux-plugins/tpm'                   # tmux Plugin Manager; autodownloads and installs any plugins you list here.
set -g @plugin 'tmux-plugins/tmux-sensible'         # Sensible defaults for tmux according to the community.
set -g @plugin 'tmux-plugins/tmux-cpu'              # Shows CPU status. Specifically, introduces variables like #{cpu_percentage} for use with `status-right`.
set -g @plugin 'tmux-plugins/tmux-net-speed'        # Shows network speed. Specifically, introduces variables like #{net_speed} for use with `status-right`.
set -g @plugin 'tmux-plugins/tmux-prefix-highlight' # Shows when you've hit the tmux prefix. Specifically, introduces the variable #{prefix_highlight} for use with `status-right`.
set -g @plugin 'tmux-plugins/tmux-sidebar'          # Shows file listings as a sidebar. Invoke with <prefix> <tab>
set -g @plugin 'tmux-plugins/tmux-resurrect'        # Allows you save and restore tmux environments (e.g. if you need to reboot). Invoke with <prefix> <Ctrl+S> and <prefix> <Ctrl+R>

# tmux-sidebar config (depends on `tree` being installed)
set -g @sidebar-tree-command 'tree -lL 2 -hDF -c -C' # See `man tree` for full explanation. TL;DR: follow symbolic links, max depth 2; show size, last changed date, an an indicator for directory/socket/executable/etc.;  sort by recently changed; colorize
set -g @sidebar-tree-width '60' # Because we added so much info, make the default width a bit wider.

# What to show in the bottom right corner (depends on tmux-cpu, tmux-net-speed, tmux-prefix-highlight)
set -g status-right-length 75 # 50 < perfect < 75
set -g @prefix_highlight_show_copy_mode 'on' # Show when copy mode is on.
set -g @prefix_highlight_show_sync_mode 'on' # Show when sync mode is on.
set -g @net_speed_format "D:%7s U:%7s" # Default string format is too wide IMHO.
set -g status-right '#{prefix_highlight} #{cpu_bg_color}CPU: #{cpu_icon} #{cpu_percentage} #{ram_bg_color}RAM: #{ram_icon} #{ram_percentage} #[bg=green]| #{net_speed} | %a %h-%d %H:%M'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant