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

Preview-tui and kitty: previewing large gif file ( >7 mb) doesn't free ram upon closing nnn or preview-tui plugin #1748

Closed
6 of 7 tasks
izmyname opened this issue Oct 14, 2023 · 3 comments
Labels

Comments

@izmyname
Copy link

izmyname commented Oct 14, 2023

  • Operating System: Arch Linux
  • Desktop Environment: i3
  • Terminal Emulator: kitty
  • Shell: zsh
  • Custom desktop opener (if applicable): none
  • Program options used: exP -p(preview-tui)
  • [ ] Configuration options set:
  • Plugins are installed: 'm:mtpmount;p:preview tui;f:fzopen;M:nmount;s:suedit;u:getplugs;g:gpge;G:gpgd;i:-!|mediainfo "$nnn";l:-!less -iR "$nnn"*;x:!&gio launch "$nnn"'
  • [ ] Issue exists on nnn master: unsure, but plugins are the latest version.

Exact steps to reproduce the issue

I. Launch nnn and preview-tui plugin

II. Focus on a large gif file (>7mb). It will cause increased ram usage, the gif will be displayed with approximately 5 seconds delay.

III. Close preview-tui and nnn. Increased ram usage remains as if the gif were still rendering.

There aren't any the gif-related files in /tmp, opening the gif directly from terminal with icat kitten, then closing the terminal reduces ram usage back.

@izmyname izmyname added the bug label Oct 14, 2023
@izmyname
Copy link
Author

izmyname commented Oct 14, 2023

UPD: It looks like the RAM is freed if all the gif's frames are rendered, but closing preview-tui or nnn, prior that, causes the problem and semi-rendered gif remains somewhere in RAM causing increased usage.

@luukvbaal
Copy link
Collaborator

luukvbaal commented Oct 15, 2023

Is this really an issue with preview-tui? I can reproduce the problem with kitty but it seems to me that it should be up to kitty or the icat kitten to release the memory.

Problem is not present with ueberzug which uses an insignificant amount of memory in the first place. I see memory usage increase with 500MB each time I open and close preview-tui in kitty on a large gif, lol.

@luukvbaal
Copy link
Collaborator

luukvbaal commented Oct 15, 2023

I can reproduce simply with:

wget https://upload.wikimedia.org/wikipedia/commons/0/0b/New_cyclic_large.gif
kitty +kitten icat --transfer-mode=stream New_cyclic_large.gif

Repeatedly executing icat in --transfer-mode=stream and pressing Ctrl-C to exit results in ever increasing memory usage. The memory is never freed even after closing the terminal.

I would suggest to open an issue over on the kitty repo, though it seems the previous one was shot down: kovidgoyal/kitty#6627.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants