Skip to content
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

VLC's memory consumption steadily increases after switching to next videos #63

Open
shlomif opened this issue Oct 12, 2016 · 4 comments

Comments

@shlomif
Copy link

shlomif commented Oct 12, 2016

Hi!

If I enqueue the videos (*.webm, *.flv, *.mp4, etc.) in my collection and rapidly switch them which can be done by running vlc --intf qt --extraintf telnet --telnet-password foo foo.xspf and using this script with "PASSWORD=foo":

#!/usr/bin/perl

use strict;
use warnings;

use Time::HiRes qw(sleep);

use Net::Telnet;

my $t = Net::Telnet->new(Timeout => 10);

my $PASSWORD = $ENV{PASSWORD};

$t->open(Host => 'localhost', Port => 4212);

$t->waitfor('/Password:/');
$t->print("$PASSWORD\n");

while (1)
{
    $t->cmd("next\n");

    sleep(0.2);
}

=head1 COPYRIGHT & LICENSE

Copyright 2015 by Shlomi Fish

This program is distributed under the MIT (X11) License:
L<http://www.opensource.org/licenses/mit-license.php>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

=cut

this is with the default vdpau interface of VLC, and while using Mageia Linux x86-64 v6. Anyway, after doing this the memory consumption of VLC rapidly climbs - even beyond 10% of my 8 GB of RAM (which is even more than Firefox takes). I tested this on JWM And on Plasma 5. It does not seem to happen with VLC's Xcb output.

Please look into fixing it and sorry to be the harbinger of bad news again.

@i-rinat
Copy link
Owner

i-rinat commented Oct 22, 2016

Hi.

Looks like I'm going to blame someone else. :-)

First of all, there are some difficulties with running VLC under Valgrind when libvdpau-va-gl is used. I don't know why, but it causes errors, while without Valgrind it works fine. And also there is some leaks that even tests have. But I don't know how to fix them, since memory is kept allocated even if I destroy all GLX contexts. Perhaps Mesa3d is caching memory for some reason. So, there is a dead end on this path.

Next, I confirm that there is a leak of some kind when "next" command is issues with a high frequency. It doesn't look like XCB output is affected, but only until frequency increase by removing sleep command completely. Then it starts eating memory, even without libvdpau-va-gl used.

When I started to write this, memory consumptions were 4.5G VIRT, 2.5G RSS. Now they are 4.7G VIRT and 2.67G RSS. Which is kind of suprising, since I turned script off a while ago. Probably, commands were buffered somehow.

@i-rinat
Copy link
Owner

i-rinat commented Oct 22, 2016

Also Xorg ate 3G of memory. And it doesn't look like it's going to give it back.

@shlomif
Copy link
Author

shlomif commented Oct 24, 2016

@i-rinat : hi! Thanks for the replies and I'm sorry for not replying sooner. Do you know where the bug is? Which one of us should report it elsewhere and where? Any insight would be appreciated.

@i-rinat
Copy link
Owner

i-rinat commented Oct 25, 2016

Do you know where the bug is?

I tried to find anything, but I'm not familiar with the VLC code. There are too many modules, I don't where to start. I probably will try to look deeper, but I could easily take weeks, if not months for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants