Crazy memory usage until script crashes
Closed this issue · 2 comments
obiraaij commented
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
vitoyucepi commented
Hi @obiraaij,
- What are the specs of your server?
- How much memory do you have?
Usefree -m
to get memory info. - Which version of ocaml are you running?
Useopam switch list
to list all opam switches. - 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.
obiraaij commented
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!