savonet/liquidsoap

Crazy memory usage until script crashes

Closed this issue · 2 comments

Hello,

I run scripts that record icecast streams and create hourly files from them for future reference. When I run one of these scripts it starts filling up memory until there is none left, and then crashes. I'm not sure where to go from here. No error messages, nothing in the logs, just a memory fill and then a crash.

url = "https://icecasturlhere"

output_folder = "/folderhere"

stream = mksafe(input.http(url))

# Output file configuration
output.file(
    %ffmpeg(format="mp3", %audio(codec="libmp3lame", samplerate=44100, b="128k")),
    output_folder ^ "/" ^ time.string("Recording_%Y-%m-%d_%H.mp3"),
    reopen_when={0m0s},
    stream
)

Version details

  • OS: Debian 11 on a VPS
  • Version 2.2.5
  • Installed through opam

Hi @obiraaij,

  1. What are the specs of your server?
  2. How much memory do you have?
    Use free -m to get memory info.
  3. Which version of ocaml are you running?
    Use opam switch list to list all opam switches.
  4. May I have a look at your liquidsoap --build-config?

It looks like you are using ocaml 5. It's a known issue that it can use up to 3 times more memory than ocaml 4.

You're right. I was using ocaml 5, that was the problem. Though I have started over and decided to run it in docker. Thanks for your help, though!