Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Big memory leak with image resizeing #1418

Closed
petterssonjonas opened this issue Mar 4, 2020 · 12 comments
Closed

Big memory leak with image resizeing #1418

petterssonjonas opened this issue Mar 4, 2020 · 12 comments

Comments

@petterssonjonas
Copy link

I use Arch, btw. Latest packages of Kitty 0.16.0, neofetch 6.1.0, fish 3.1.0.

I've had problems getting neofetch to show an image for a few days.
Got it working for the standard image size, but i wanted to figure out why it would'nt resize.

It turns out the issue is image resizing and writing pixel cache -related.
Now this may not be an issue with neofetch itself. I dont really know.

Ran neofetch -v and the previous thumbnail failed to load so i removed it. I re-ran neofetch and luckily i had htop running in another terminal, and i noticed my memory was being eaten up. A few seconds and all 16gb was full. This happens when i set image_size="auto" or a %-age.

convert: unable to write pixel cache '/tmp/magick-158278bty4e63qSdyp': No space left on device @ error/cache.c/WritePixelCachePixels/5830.
Setting it to 140px (or any pixel value) gives me the error cant open thumbnail, no memory leak.

Failed to open image: ~/.cache/thumbnails/neofetch/normal-center-140-140-homefuze.configneofetcharchlogo.png.png with error: convert: negative or zero image size ~/.cache/thumbnails/neofetch/normal-center-140-140-homefuze.configneofetcharchlogo.png.png' @ error/resize.c/ResizeImage/3741.

Config file

https://pastebin.com/vYE407DZ

Verbose log

https://pastebin.com/nFB6duUL

Kitty conf

https://pastebin.com/hyCPwPjd

@dylanaraps
Copy link
Owner

Does this still occur in master?

@dylanaraps
Copy link
Owner

Also:

++ kitty +kitten icat --print-window-size
+ ((  65535 < 50  ))
+ term_width=65535

This seems very wrong.

@petterssonjonas
Copy link
Author

I just yay installed neofetch-git, still happens.
I have not set term_width to 65535. Whats with that?

Found the issue on kittys github. Its an issue with fish.
Going over there now to lurk more.
kovidgoyal/kitty#2026

@dylanaraps
Copy link
Owner

So, does it work from bash as your shell?

@petterssonjonas
Copy link
Author

Tried to reproduce the leak in bash, and could'nt.
Still in bash i still get the same window-size

fuze  ~  kitty +kitten icat --print-window-size
65535x65535

The thumbnail issue was still there, looks like a permissions issue, chmodded the thumbnail 777 and it worked.

I dont see an issue up on fish's github about this specifically, but then there are pages and pages of issues, and i cant come up with a good search term.

@dylanaraps
Copy link
Owner

Try the latest master in fish and bash. 👍

@petterssonjonas
Copy link
Author

Installed master and term size is still the same. Memory leak is still happening.
Also thumbnail issue is back, cant open thumbnails no matter the pixelsize.

@dylanaraps
Copy link
Owner

Send a log? Also, does this issue occur in other terminal emulators?

@petterssonjonas
Copy link
Author

Other terminal emulators dont use the kitty backend. Using w3m in alacritty pops the image up at the correct size (at auto) but dissapears right away. Same with termite.

In alacritty with kitty backend it "checks for graphics 10s.." and no leak. Alacritty seems to check for support first and not run the kitten.
Actually so does xterm. Re checked termite and it checks too.

Gotta be a kitten-problem?

@petterssonjonas
Copy link
Author

Log running with kitty backend in termite

https://pastebin.com/HZSkhsfH

@dylanaraps
Copy link
Owner

I'm closing this under #1392. I believe this is kitty and/or fish related overall though.

@petterssonjonas
Copy link
Author

Looks like it. Ty for your time. Might do an issue over there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants