question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Memory Leak

See original GitHub issue

Hi, thank you for making this very useful project, it’s really awesome.

I’m experiencing a suspected memory leak during my use.

When load a large batch of songs, I can see the memory usage slowly growing.

I’d like to ask you if there are any areas I can look at to help locate a fix for this memory leak?

My environment is Ubuntu 20 and python 3.8.

sample code:


import sys

from librespot.core import Session
from librespot.metadata import TrackId
from librespot.audio.decoders import AudioQuality, VorbisOnlyAudioQuality

account_user = ''
account_passwd = ''
session = Session.Builder().user_pass(account_user, account_passwd).create()


def load_data_from_spotify(track_id):
    spotify_track_id = TrackId.from_uri('spotify:track:' + track_id)
    stream = session.content_feeder().load(spotify_track_id, VorbisOnlyAudioQuality(AudioQuality.NORMAL), False, None)
    audio_buffer = stream.input_stream.stream().read()

    # dosomething



Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kokarare1212commented, Jul 21, 2022

Yes, that is because the buffer has not been released.

0reactions
staniel359commented, Aug 31, 2022

@kokarare1212 Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memory leak - Wikipedia
In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in...
Read more >
Three kinds of memory leaks - Made of Bugs - Nelson Elhage
Type (1): Unreachable allocations ︎. This is the classic C/C++ memory leak. Someone allocated memory with new or malloc , and never called ......
Read more >
How do I check for memory leaks, and what should I do to stop ...
Tracking down a memory leak can be a difficult process. Let's say a program runs for a brief amount of time and has...
Read more >
Incident report on memory leak caused by Cloudflare parser bug
It turned out that the underlying bug that caused the memory leak had been present in our Ragel-based parser for many years but...
Read more >
CSCvn46171 - Rapid Memory Leak in "FED Main ... - Cisco Bug
Cisco Bug: CSCvn46171 - Rapid Memory Leak in "FED Main Event" Process due to Modifying Adjacencys.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found