Page 1 of 1

Memory leak in multiple start/stop playback

Posted: 31 Mar 2016 11:53
by Alexolut
After multiple start/stop playback of any kind of source (I tested on regular avi file & rtsp source) I see a memory usage increasion (via ProcessExplorer, TaskManager).
E.g. when I start playback at first time - I see 116 Mb. After a lot of stop/play commands (tested manually by pressing "s"/space keys aprox. 5 minutes) value of used memory increased by ~10 Mb.
Tested on 2.2.2 & 3.0.0-git 30-03-2016 win32.
My OS is Windows 7 Pro 64 bit.

Re: Memory leak in multiple start/stop playback

Posted: 02 Apr 2016 00:11
by jayR
Such minor increase is normal. As you use more, memory will increase.

Re: Memory leak in multiple start/stop playback

Posted: 02 Apr 2016 10:40
by Alexolut
I use libvlc in my application, which should run without restarts. Increased memory usage in vlclib with similar regular activities (start / stop playback) excludes the possibility of such an interaction. I believe that the memory usage does not grow indefinitely in such cases.

Do you know how to perform a simple way to start / stop cycle automatically?
This need for greater confidence in the veracity of my version.

Re: Memory leak in multiple start/stop playback

Posted: 04 Apr 2016 15:40
by Alexolut
To confirm the fact of leaks, I started VLC to receive commands from telnet:

Code: Select all

vlc -I telnet --telnet-password=secret --telnet-port=9999
I created a test application which sends telnet commands (play,stop) to vlc in a loop.
play, sleeping for 100ms, stop ... and so on.

The graph clearly seen a steady increase in memory process in the Task Manager.
Image
After about 12 minutes the player has ceased to respond to the telnet client command.
If you create a new client, the commands start to be processed again.

Re: Memory leak in multiple start/stop playback

Posted: 04 Apr 2016 16:21
by Rémi Denis-Courmont
That's not very useful infos. It could be due to memory fragmentation, caching, or leaks in some library beyond VLC's control...

If you want to find and fix leaks, you should probably use proper debugging tools.

Re: Memory leak in multiple start/stop playback

Posted: 04 Apr 2016 17:06
by Alexolut
That's not very useful infos. It could be due to memory fragmentation, caching, or leaks in some library beyond VLC's control...
I know that VLC is complicated program with many dependencies. But I'm using end product "VLC player", and I see leaks in that product.
If you want to find and fix leaks, you should probably use proper debugging tools.
I'm not familiar with VLC debugging. Can you tell my in short terms what I need to do, and what is "proper debugging tools"?
Maybe you can give me some usefull links with information which steps I should be done to prove that leak inside VLC. Not on other side.

Re: Memory leak in multiple start/stop playback

Posted: 04 Apr 2016 17:42
by Rémi Denis-Courmont
FWIW, I used to track leaks with valgrind. Nowadays, I mostly use LSan. I can't provide specific help for Windows.

And this is not about proving things. This is about fixing things.