Stream to memory with libvlc_video_set_callbacks, possible memory leak

This forum is about all development around libVLC.
algrev
New Cone
New Cone
Posts: 5
Joined: 28 Jan 2019 21:56

Stream to memory with libvlc_video_set_callbacks, possible memory leak

Postby algrev » 28 Jan 2019 22:30

I am testing a way to get RGB matrix from a RTSP stream with the Python (3.6) code at https://pastebin.com/CuVh2DgY

Tested on several Environments:
1) OSX Mojave 10.14.1, VLC 3.0.4
2) Ubuntu 16.04/18.04, VLC 3.0.4
3) A docker container on the mac in 1), running Ubuntu 16.04 image

In case 1) and 3), the memory of python/docker soars high in a short time and the code blows up. However, in 2) the code runs with very low memory usage for a long time.

Similar behaviors can be reproduced with C++ code with identical logic.

Any comments, solutions or workarounds of this problem will be appreciated! Thanks!

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Stream to memory with libvlc_video_set_callbacks, possible memory leak

Postby Rémi Denis-Courmont » 29 Jan 2019 16:50

LeakSanitizer ?
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

algrev
New Cone
New Cone
Posts: 5
Joined: 28 Jan 2019 21:56

Re: Stream to memory with libvlc_video_set_callbacks, possible memory leak

Postby algrev » 29 Jan 2019 18:34

Just tested by adding -fsanitize=address to g++ compiler option on OSX. No leak is detected, but memory consumption still goes up to 1.5G after playing ~1000 frames.

Refer to http://www.voidcn.com/article/p-ofvdtpnv-bgn.html or https://github.com/berak/facereco/blob/ ... apture.cpp for an idea of the C++ code I use for testing.

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Stream to memory with libvlc_video_set_callbacks, possible memory leak

Postby Rémi Denis-Courmont » 29 Jan 2019 22:19

1.5 G with address sanitizer looks suspiciously little, actually.

Just abort the program while running. There should be a lot of leaks - but it should be obvious which one(s) are massive and which ones are just a side effect of aborting.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

algrev
New Cone
New Cone
Posts: 5
Joined: 28 Jan 2019 21:56

Re: Stream to memory with libvlc_video_set_callbacks, possible memory leak

Postby algrev » 29 Jan 2019 23:17

Alright, Sanitizer caught something. The following happens, but not always:

The log is too long to paste here. See https://pastebin.com/29Rv3Trh

Regardless of whether this happens, the memory issue still seems to be there.

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Stream to memory with libvlc_video_set_callbacks, possible memory leak

Postby Rémi Denis-Courmont » 30 Jan 2019 19:27

That's a crash. I don't see the link with the initially reported problem.

This is too vague. I cannot help you and I doubt anybody else can.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

algrev
New Cone
New Cone
Posts: 5
Joined: 28 Jan 2019 21:56

Re: Stream to memory with libvlc_video_set_callbacks, possible memory leak

Postby algrev » 30 Jan 2019 21:13

Sorry I know this is a dumb question, but what kind of test and log info shall I post here to make the discussion productive?

By "aborting the program while running", do you mean something like sending a kill -SIGABRT? Doing that on a mac will lead to a crash report generated. Will that be anything helpful?

Tibweizh
New Cone
New Cone
Posts: 7
Joined: 28 Jun 2019 09:03

Re: Stream to memory with libvlc_video_set_callbacks, possible memory leak

Postby Tibweizh » 28 Jun 2019 10:00

Hi algrev,

I'm facing the same problem, did you find something ?

Thanks


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 44 guests