-
Hi, first of all thank you so much for maintaining this project! I noticed that when playing a long audio file (e.g. a 12-hour track around 1GB in size) from an HTTP source, the entire file seems to be loaded into memory at once. This results in about 1GB of memory usage, which could potentially lead to memory leaks or high memory pressure over time. If possible, I’d like to suggest supporting HTTP range requests for such sources, so that audio data can be loaded in smaller chunks rather than all at once. I think this might help with overall resource efficiency. Thanks again for all your hard work! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Lavaplayer already utilises the range header (I have an API endpoint that works with it so I can attest to this behaviour.) It is also atypical for Lavaplayer to buffer the entire file in memory—it is designed to keep memory usage to a minimum and implements buffers for this very reason. It will read audio frames from a track until the internal audio frame buffer is full (which defaults to about 5 seconds worth of audio.) If its using uncontrolled amounts of memory, this may be because you have your buffer values set too large. |
Beta Was this translation helpful? Give feedback.
-
In my tests using Lavalink 4.1.1 (which includes Lavaplayer 2.2.3) with an HTTP source, playing a 400 MB audio file resulted in approximately a 400 MB increase in system RAM usage test result video: https://youtu.be/ST3vNf_7uWQ?si=doz9PA4n4t59cxQ6 |
Beta Was this translation helpful? Give feedback.
Lavaplayer already utilises the range header (I have an API endpoint that works with it so I can attest to this behaviour.)
It is also atypical for Lavaplayer to buffer the entire file in memory—it is designed to keep memory usage to a minimum and implements buffers for this very reason. It will read audio frames from a track until the internal audio frame buffer is full (which defaults to about 5 seconds worth of audio.) If its using uncontrolled amounts of memory, this may be because you have your buffer values set too large.