-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak with input.harbor and FLAC #9
Comments
if you are looking for a quick fix, you could try disabling the native flac decoder and use ffmpeg instead? |
It would be great to be able to confirm that the problem comes from the |
Thanks for your quick response! I haven't used ffmpeg with liquidsoap before, but I will try to set it up tomorrow. |
I've tried to replace the native decoder with ffmpeg, but failed.
|
I think we meant the internal
|
I think that I can reproduce with: set("log.level",4)
set("decoder.file_extensions.ffmpeg",[])
s = single("/tmp/bla.ogg")
clock.assign_new(sync="none",[s])
output.dummy(s) |
Looks pretty stable with |
Pretty stable in pure flac decoding (after fixing a bug in the decoder!), so likely somewhere in |
Ok, looks like the issue is fixes in the current |
Fixed |
@toots thanks a lot! |
Ho damn. I hope it stabilizes.. |
It still increases steadily :( Just to be sure that I've installed the update correctly yesterday:
|
Based on your sample in https://github.com/savonet/liquidsoap/issues/1146#issuecomment-612641697 I've tried to simulate the stream we get from our customer, but I failed (my setup: one instance that produces an ogg-flac stream with While debugging my setup for the simulation, I increased the loglevel on the relay instance. I've appended parts of the log below. Fyi: "relay_output" is the
I hope this helps a bit in finding the issue. |
Well damn.. 😅 At least I'm pretty sure I did fix an unrelated memleak.. I just shouldn't have rushed the release.. Thanks for all these details, I'll have another pass on it. Also, it looks like I did break I'll hit you up when I have a new binding to test. |
@toots First I have to thank you for your effort! 👍
For me it looks like I've deployed the latest version, I pinned the 0.1.6 branch yesterday, it recompiled liquidsoap and the log tells me Just to be sure: you are saying you've broken the Also, no worries! All my tests are only deployed on our test environment at the moment. So I'm looking forward to test upcoming changes there 😄 |
Great! When I say broken, I mean that I can reproduce your issue with the stream disconnecting at each end-of-track. I self-inflicted myself with the infamous ogg decoder bug where decoders think end of track = end of stream.. (the ogg specs isn't great on this one). I have a fix for that but I'm also seeing some much slower memleak that I'm testing. And I think this time we should run it by you before a new release 😅 |
Good to know! Would you be able to test with the latest I can reproduce the allocations increase and observe them with |
I've pinned
I first tried rebuilding after |
My bad I meant to say the |
Hey! I found the issue. The C callbacks need to register their thread with the OCaml GC as explained here: https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#s%3AC-multithreading. It's a pretty annoying change so I'm gonna take a minute to think about it but it'll get done as soon as possible. I'm transferring this issue to |
Hm, still seeing an increasing memory usage. I've updated the pinned 0.1.7 branch of |
It's possible that the bug is still here and wasn't caught in those changes but they clearly fixed a leak on my end. I would recommend to fully
|
I've re-pinned it as you said a few days ago, the memory is still increasing. Nevertheless thank you for your effort to find the issue! Should we open a new issue or do you re-open this one? |
Let's reopen so that we don't forget. |
Describe the bug
We are facing liquidsoap instances with constantly increasing memory usage. It seems like it has started with the customer's switch from mp3 to an Ogg/FLAC stream.
It also seems like the issue is related to the metadata inside the stream, as during the night, where the metadata density is very low, the memory keeps its level or grows very slow.
I don't know, if that helps: disconnects of the input stream do not change/free the memory.
Some notes to our setup and why FLAC seems to have the problem for us:
To Reproduce
Unfortunately, I think I cannot give you access to our customer's FLAC stream. It should have metadata. Our "relay" from above is actually dead simple:
Expected behavior
no leak :)
Version details
Install method
Ubuntu package (1.1.1) and
opam
(1.3.7, 1.4.1)The text was updated successfully, but these errors were encountered: