[GH-ISSUE #318] Leak of memory on iTerm2 after long period of usage #1103

Closed
opened 2026-03-14 13:28:09 +03:00 by kerem · 9 comments
Owner

Originally created by @diegoulloao on GitHub (Dec 10, 2023).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/318

Describe the bug
For some reason after open spotify player the iterm2 memory is increasing little by little in the meanwhile the TUI is opened and playing music.

To Reproduce
Just play music for a more than 30 minutes and check the memory usage every so often.

Expected behavior
Do not see anomalies in the memory usage while using the TUI for long amount of time.

Log and backtrace
Not important, no error occurred.

Screenshots
Screenshot 4

Environment

  • OS: macOs Sonoma 14.1.2
  • Application version: latest
  • Application features: image, media control

Additional context
Running on Iterm2 Build 3.4.22

Only 2 tabs/processes opened:

  1. spotify_player
  2. nvim

This behavior only occurs when spotify player is open.

important

After a couple of hours of usage, the memory reached even 38GB!!
The capture above is after 15 minutes of usage, it reached 3GB.

Originally created by @diegoulloao on GitHub (Dec 10, 2023). Original GitHub issue: https://github.com/aome510/spotify-player/issues/318 **Describe the bug** For some reason after open spotify player the iterm2 memory is increasing little by little in the meanwhile the TUI is opened and playing music. **To Reproduce** Just play music for a more than 30 minutes and check the memory usage every so often. **Expected behavior** Do not see anomalies in the memory usage while using the TUI for long amount of time. **Log and backtrace** Not important, no error occurred. **Screenshots** <img width="270" alt="Screenshot 4" src="https://github.com/aome510/spotify-player/assets/45423661/02bca099-dbca-4660-91dc-438d390b6671"> **Environment** - OS: macOs Sonoma 14.1.2 - Application version: latest - Application features: image, media control **Additional context** Running on Iterm2 Build 3.4.22 Only 2 tabs/processes opened: 1. `spotify_player` 2. nvim This behavior only occurs when spotify player is open. ## important After a couple of hours of usage, the memory reached even `38GB`!! The capture above is after 15 minutes of usage, it reached `3GB`.
kerem 2026-03-14 13:28:09 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@diegoulloao commented on GitHub (Dec 10, 2023):

By the way I'm in love with this project, I was using it all the past days, now, the only thing that's stopping me of using it is the memory usage leak it causes.

Hope I can find some kind of solution on this issue.
Thank you!

<!-- gh-comment-id:1849032225 --> @diegoulloao commented on GitHub (Dec 10, 2023): By the way I'm in love with this project, I was using it all the past days, now, the only thing that's stopping me of using it is the memory usage leak it causes. Hope I can find some kind of solution on this issue. Thank you!
Author
Owner

@aome510 commented on GitHub (Dec 10, 2023):

@diegoulloao what is the value of Scrollback lines in the Terminal tab of your ITerm2 settings? Using a large or unbounded scrollback buffer may cause a memory issue as rendered images are kept inside the scrollback buffer.

<!-- gh-comment-id:1849072735 --> @aome510 commented on GitHub (Dec 10, 2023): @diegoulloao what is the value of `Scrollback lines` in the **Terminal** tab of your ITerm2 settings? Using a large or unbounded scrollback buffer may cause a memory issue as rendered images are kept inside the scrollback buffer.
Author
Owner

@aome510 commented on GitHub (Dec 10, 2023):

FYI, I use 1000 for scrollback lines and have never seen ITerm2 memory usage exceed 2GB. Memory usage can be estimated with each image's size is about 1MB, so 1000 means memory usage (only for images) is about 1GB.

Edit: it does exceed 2GB for me after a while, so this issue may not be related to the scrollback buffer

<!-- gh-comment-id:1849074849 --> @aome510 commented on GitHub (Dec 10, 2023): FYI, I use `1000` for scrollback lines and have never seen ITerm2 memory usage exceed `2GB`. Memory usage can be estimated with each image's size is about `1MB`, so `1000` means memory usage (only for images) is about `1GB`. **Edit**: it does exceed 2GB for me after a while, so this issue may not be related to the scrollback buffer
Author
Owner

@diegoulloao commented on GitHub (Dec 10, 2023):

Screenshot 6

Using 1000 too. Is very weird, after 3-4 hours of usage my memory reached 38GB using +swap

<!-- gh-comment-id:1849088779 --> @diegoulloao commented on GitHub (Dec 10, 2023): <img width="594" alt="Screenshot 6" src="https://github.com/aome510/spotify-player/assets/45423661/8ffe465f-baf1-4f1b-908e-d47107e22566"> Using `1000` too. Is very weird, after 3-4 hours of usage my memory reached `38GB` using +swap
Author
Owner

@aome510 commented on GitHub (Dec 11, 2023):

@diegoulloao try to resolve the issue in https://github.com/aome510/spotify-player/pull/319. Can you checkout the branch and test the changes?

<!-- gh-comment-id:1849146797 --> @aome510 commented on GitHub (Dec 11, 2023): @diegoulloao try to resolve the issue in https://github.com/aome510/spotify-player/pull/319. Can you checkout the branch and test the changes?
Author
Owner

@diegoulloao commented on GitHub (Dec 11, 2023):

@diegoulloao try to resolve the issue in #319. Can you checkout the branch and test the changes?

Sure! first I need to know, how do I change the branch? Sorry, I'm not familiar with rust or cargo.
I installed the app using cargo so long time ago.

Thanks for the quick fix and PR! ❤️

<!-- gh-comment-id:1849149115 --> @diegoulloao commented on GitHub (Dec 11, 2023): > @diegoulloao try to resolve the issue in #319. Can you checkout the branch and test the changes? Sure! first I need to know, how do I change the branch? Sorry, I'm not familiar with rust or cargo. I installed the app using cargo so long time ago. Thanks for the quick fix and PR! ❤️
Author
Owner

@aome510 commented on GitHub (Dec 11, 2023):

@diegoulloao try to resolve the issue in #319. Can you checkout the branch and test the changes?

Sure! first I need to know, how do I change the branch? Sorry, I'm not familiar with rust or cargo. I installed the app using cargo so long time ago.

Thanks for the quick fix and PR! ❤️

You can run the below command in the repo's root

git fetch && git checkout fix-memleak-with-image && cargo run --features image
<!-- gh-comment-id:1849154566 --> @aome510 commented on GitHub (Dec 11, 2023): > > @diegoulloao try to resolve the issue in #319. Can you checkout the branch and test the changes? > > Sure! first I need to know, how do I change the branch? Sorry, I'm not familiar with rust or cargo. I installed the app using cargo so long time ago. > > Thanks for the quick fix and PR! ❤️ You can run the below command in the repo's root ``` git fetch && git checkout fix-memleak-with-image && cargo run --features image ```
Author
Owner

@diegoulloao commented on GitHub (Dec 11, 2023):

Ok, let me try it for 30 minutes 🕦 I'll reply

<!-- gh-comment-id:1849160105 --> @diegoulloao commented on GitHub (Dec 11, 2023): Ok, let me try it for 30 minutes 🕦 I'll reply
Author
Owner

@diegoulloao commented on GitHub (Dec 11, 2023):

replied.

<!-- gh-comment-id:1849171374 --> @diegoulloao commented on GitHub (Dec 11, 2023): replied.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#1103
No description provided.