vlc memory leak

Bug #743323 reported by Gahataka on 2011-03-26
676
This bug affects 142 people
Affects Status Importance Assigned to Milestone
VLC media player
Fix Released
Undecided
Rémi Denis-Courmont
pulseaudio (Ubuntu)
Undecided
Unassigned
Natty
Undecided
Unassigned
vlc (Ubuntu)
High
Unassigned
Natty
High
Unassigned

Bug Description

Binary package hint: vlc

While watching a macromedia flash video, when i paused the video and restarted it, I've got a memory leak in vlc (the process vlc takes the whole memory in 10 secondes).

 Also, in some case, when the process vlc was killed by the kernel and when i retrieve the control of my pc, compiz was disabled while it was enabled before the memory leak.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: vlc 1.0.6-1ubuntu1.5
ProcVersionSignature: Ubuntu 2.6.32-30.59-generic 2.6.32.29+drm33.13
Uname: Linux 2.6.32-30-generic x86_64
NonfreeKernelModules: fglrx
Architecture: amd64
Date: Sat Mar 26 22:23:17 2011
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Release Candidate amd64 (20100419.1)
ProcEnviron:
 LANG=fr_FR.utf8
 SHELL=/bin/bash
SourcePackage: vlc

Gahataka (gahataka) wrote :
Gahataka (gahataka) wrote :

Here is the valgrind log

Changed in vlc (Ubuntu):
status: New → Incomplete
status: Incomplete → New

also happens for mkv files - and the leak happens after pausing - resume is not required to reproduce (at least for me)

David Tomic (david-tomic) wrote :

This has been happening pretty frequently to me as well. Ubuntu 11.04 x64.

I've got 8GB of RAM in this system, and it normally sits on ~2.5GB used.

When VLC decides to go crazy the RAM shoots up to 100% usage [very quickly], and then my swap space starts getting eaten up as well.

If the swap space fills up completely, then the whole system basically becomes completely unresponsive, and I need to do a hard reset in order to get it running again.

If I can catch it before that happens though, and manage to kill the VLC process, then my memory usage drops back to normal, but any swap space that's been eaten up stays like that until the next time I reboot.

I've basically had to give up on using VLC until this gets resolved ...

I have had vlc running on Debian 6 for days on end and have not had this issue; but I have encountered it on Ubuntu 10.10. Perhaps Ubuntu patches are causing this?

Also, you can reset swap with: sudo swapoff -a && sudo swapon -a

Changed in vlc (Ubuntu):
status: New → Confirmed
status: Confirmed → New
Benjamin Drung (bdrung) wrote :

There's no difference between the Debian and Ubuntu package that could explain the different behavior. The bug could be triggered by different library version or by different plugins. Do you use pulseaudio on Ubuntu, but alsa on Debian?

dazza5000 (darran-kelinske) wrote :

im experiencing this issue in natty - vlc will use up all available ram and then the swap disk making the system completely unuseable - I have to hard reboot the entire box - this consistently happens to me when i play .flv files

I think the problem is in the pulseaudio/vlc integration, because sometimes I have to kill pulseaudio after the crash to get sound work well again.

Changed in vlc (Ubuntu):
status: New → Confirmed
Solitaire (bill-s0l) wrote :

I'm having the same issue.

I'm using a 2Ghz celeron laptop upgraded 10.10 to 11.04 (both 32bit)
1Gb ram - 1Gb swap

Happens when playing any video (mpg, avi mvk) when its paused for 3+ mins
I only run videos using "cvlc"

vlc was rock steady in 10.10

CatchesAStar (catchesastar) wrote :

@LocutusOfBorg

Kill all pulseaudio processes
[code]
sudo mv /usr/bin/pulseaudio /usr/bin/pulseaudio.dead
sudo /etc/init.d/pulseaudio stop
sudo killall pulseaudio
[/code]

Then, set the VLC audio output to ALSA.

To return pulseaudio back to normal...
[code]
sudo mv /usr/bin/pulseaudio.dead
sudo /etc/init.d/pulseaudio start
[/code]

If using ALSA instead of pulseaudio works, then pulseaudio is the culprit.

have fun!

CatchesAStar (catchesastar) wrote :

and I mean works as in no high RAM/Resource usage.

Ok, have the same problem here.
Everything was explained yet, Im on Kubuntu Natty 32 bit.

@dolphinaura
I think you missed something in the second part of the code... :)

[code]
sudo mv /usr/bin/pulseaudio.dead /usr/bin/pulseaudio
sudo /etc/init.d/pulseaudio start
[/code]

this should be correct...

I removed pulseaudio from respawn and killed it... vlc is working also if you don't set audio output to alsa... (maybe alsa is the default now?)

Changed in pulseaudio (Ubuntu):
status: New → Confirmed
Ludovic Claude (ludovicc) wrote :

I have this issue while playing streamed video, and it can take sometimes less than 10 seconds after starting playing video when the system becomes unstable.

Here is the system log, when unity decides to kill this process. VLC takes 3.5Gb or RAM when it's killed!
http://paste.ubuntu.com/603010/

This just happened to me on Arch Linux, and is not Ubuntu-specific, but an upstream bug. According to this post:

http://forum.videolan.org/viewtopic.php?f=13&t=89771

they are aware of this issue. Also, it seems from there that the ALSA workaround does not work.

Guy Taylor (thebiggerguy) wrote :

Running VLC from git master "be80120018938f54489dc250b876a904a8206015" this does not appear.
Maybe "http://git.videolan.org/?p=vlc.git;a=commit;h=77dd16bace3e70599cab1a36fe94565bca717227"

@Guy I don't agree with "http://git.videolan.org/?p=vlc.git;a=commit;h=77dd16bace3e70599cab1a36fe94565bca717227" because as far as I can see this change is already in the ubuntu package.

hadrons123 (piruthiviraj) wrote :

i 've got the same problem and switched to fedora 14,15(beta).all the distros which has 1.1.9 vlc has the same trouble playing f4v format.i want this to be fixed as soon as possible.

Adam Niedling (krychek) wrote :

This bug is pretty annoying. VLC freezes the computer, banshee and totem don't display subtitles after seeking in the movie. This is the third time VLC breaks after a distribution upgrade. (The previous annoyance was #428884 .)

Rémi Denis-Courmont (rdenis) wrote :

Does anyone have a way to reproduce this RELIABLY?

Also the output of 'pactl list' when the bug occurs would be nice...

Changed in vlc:
assignee: nobody → Rémi Denis-Courmont (rdenis)
milestone: none → 1.2.0
status: New → Fix Released
Changed in pulseaudio (Ubuntu):
status: Confirmed → Invalid
Gahataka (gahataka) wrote :

Here is the output of the command you wanted.

Also, to reproduce this, just play a macromedia flash video, press space bar 2-3 times and then the vlc process takes the whole memory in about 10-15 seconds

@Rémi Denis-Courmont the best way to reproduce is to install boinc and let the boinc compute while you are watching a video, while processor usage is high vlc crashes instantly.

Benjamin Drung (bdrung) on 2011-05-10
Changed in vlc (Ubuntu):
importance: Undecided → High

@Rémi Denis-Courmont I'm trying to reproduce with 1.2 trunk vlc, but according to you the bug seems to be fixed there...

Could you please backport the patch to the 1.1.x release?

this affects so many users.

Benjamin Drung (bdrung) wrote :

I have been using 1.2 trunk for some time and didn't experience any memory leak or other problem with the rewritten pulseaudio output plugin.

@LocutusOfBorg: The pulseaudio output plugin was rewritten. Just pulling the new version into 1.1.x doesn't work (seeking will fail then).

Rémi Denis-Courmont (rdenis) wrote :

@LocutusOfBorg It's not a simple bug fix to be backported. It is a massive rewrite of the affected plug-in.

And then, that new version has its own problem: I perceive a lot of stutter at super-nominal playback speeds. Also sometimes audio and video are not synchronized. So I think it is not ready for releasing; that is why it is only in a development version.

In the mean time, I would advise either disabling the PulseAudio plugin from Ubuntu VLC 1.1.x builds, or lowering its priority below that of the ALSA plugin (like it was in VLC 1.0.x).

@Rémi (BTW VLC 1.2 doesn't have the control bar for controlling video speed, is it normal?)

Rémi Denis-Courmont (rdenis) wrote :

@LocutusOfBorg View -> Status bar

Very thanks! I really missed so much this feature! let's go testing the new version

Disabling pulseaudio in the ubuntu version is a good workaround, cound anybody put it into the 1.1.10 release?

holger beetz (holger-beetz) wrote :

Happens here on two systems also:
Xubuntu 10.04.2 / 32 Bit with 512 MB RAM and GeForce 4 Ti 4400
Ubuntu 10.04.2 / 64 Bit with 3GB RAM and GeForce 9800GT

Both systems are running NVidia blob.

It's not that frequent but happens now and then. To my best guess the source type of video doesn't make a big difference. Had the issue with PAL SVCD MPEG2, 640x480 flv files and h264 MP4 in 720p

Let me know if more informations are needed.

Adam Niedling (krychek) wrote :

To upgrade your VLC to the 1.2 experimental version to test if this bug is fixed follow these:

sudo add-apt-repository ppa:videolan/master-daily
sudo apt-get update
sudo apt-get upgrade

I only watched something with VLC 1.2 for 45 minutes yesterday and it did not freeze, however the video and the audio were not in sync.

Exactly the same:
"I only watched something with VLC 1.2 for 45 minutes yesterday and it did not freeze, however the video and the audio were not in sync." <<- BADLY :-(

@mime @Adam, as said before:
1) this bug is known by developers, and vlc 1.2 is *not* stable, so don't report bug here (this is a different bug) and don't use it if you think it is unusable.

2) I personally have a workaround about the sync problem. when the video is not synced anymore I press stop and I start the video again to the desired position. I have to do this at most twice every time. (so this is a good workaround :D)

3) if you don't like using an unstable vlc version I think (not tested) you can just remove pulseaudio from your system by doing apt-get remove pulseaudio. or renaming the pulseaudio executable file (as said before)
This is the best workaround since vlc won't use pulse and won't have this bug (I think it uses alsa in this case).

regards

hadrons123 (piruthiviraj) wrote :

no sync here too.but that's ok .... my firefox stutters a bit while playing flash after vlc 1.2 and flash 10.3(stable) updates. is that something to do with h.264 codec or flash i dont really know

'lade phillips (ayoayood) wrote :

ihave this problem and not just vlc, also when playing videos with both totem and banshee, machine freezes then restart
 i just installed ubuntu 11.04 i use a hp mini 2133. 1gb ram...
 i dint have this problem on ubuntu 10.10

Rémi Denis-Courmont (rdenis) wrote :

@LocutusOfBorg While you got it right that VLC 1.2 is officially unstable, all my attempts to fix audio/video synchronization in VLC 1.2 with PulseAudio have failed, and I will certainly not be able to fix it by the time VLC 1.2.0 is out.

Ubuntu (and Fedora and OpenSUSE...) have slapped PulseAudio in the face of the community. But they are not helping integrating it in VLC and other multimedia apps (except maybe gstreamer). That has not worked so far, and it will not magically start working with VLC 1.2.0.

So unless _you_ are going to fix it, I can only advise you give up on PulseAudio and revert to ALSA.

I have had the same thing happen, sometimes, with Dragon. It seems to be
pulse audio related.

On Sun, May 15, 2011 at 11:31 AM, 'lade phillips
<email address hidden>wrote:

> ihave this problem and not just vlc, also when playing videos with both
> totem and banshee, machine freezes then restart
> i just installed ubuntu 11.04 i use a hp mini 2133. 1gb ram...
> i dint have this problem on ubuntu 10.10
>
> --
> You received this bug notification because you are a direct subscriber
> of a duplicate bug (775129).
> https://bugs.launchpad.net/bugs/743323
>
> Title:
> vlc memory leak
>
> Status in VLC media player:
> Fix Released
> Status in “pulseaudio” package in Ubuntu:
> Invalid
> Status in “vlc” package in Ubuntu:
> Confirmed
>
> Bug description:
> Binary package hint: vlc
>
> While watching a macromedia flash video, when i paused the video and
> restarted it, I've got a memory leak in vlc (the process vlc takes the
> whole memory in 10 secondes).
>
> Also, in some case, when the process vlc was killed by the kernel and
> when i retrieve the control of my pc, compiz was disabled while it was
> enabled before the memory leak.
>
> ProblemType: Bug
> DistroRelease: Ubuntu 10.04
> Package: vlc 1.0.6-1ubuntu1.5
> ProcVersionSignature: Ubuntu 2.6.32-30.59-generic 2.6.32.29+drm33.13
> Uname: Linux 2.6.32-30-generic x86_64
> NonfreeKernelModules: fglrx
> Architecture: amd64
> Date: Sat Mar 26 22:23:17 2011
> InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Release Candidate amd64
> (20100419.1)
> ProcEnviron:
> LANG=fr_FR.utf8
> SHELL=/bin/bash
> SourcePackage: vlc
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/vlc/+bug/743323/+subscribe
>

--
Phil Hughes
<email address hidden>

well, this is certainly not the roght aproach, I have to stand up in favour pulsaudio! it is a great thing and does a lot moe than alsa, going back would be a great step back. the thing is that pulseaudio is more complicated, thus more possibilities how to mess things up. if u have this approach, go back to windows 95, which knows nothing, but it is stable, would u do that? the right approach is to improve, not give up. anyway, I see a great imrovement in pulseuadio, sometimes little steps backwards, but still, it is improving. on the other hand, Ubuntu is probably not the best OS in terms of puleaudio integration, but as i say, things are improving by leaps and bounds!

Alex C (alexcrouch) wrote :

I was running Ubuntu 10.10 x64 and have been trying to fix this with VLC 1.1.8 and 1.1.9 by trying to have 'ASLA AUDIO OUTPUT' set in my vlc audio settings but I'm still having problems with this.

So I figured I would upgrade to Ubuntu 11.04 and see if anything improved. Well it did in that it doesn't log me out but the problem is still there!

This problem is so serious I completely run out of ram and swap and end up with a near impossible to use machine (until I kill the power or have a lot of patience and try and kill the process). My hard drive has taken a battering just working out what this is, initally I couldn't even open a terminal to find out what was going on!

And this is just with a 128k audio stream!

Please let me know if there is any more information I can provide to help!

Changed in vlc:
milestone: 1.2.0 → 1.1.10
tags: added: patch
30 comments hidden view all 110 comments
Rémi Denis-Courmont (rdenis) wrote :

/me thinks it should be extensively tested before it gets back-ported to any stable Ubuntu release.

Jean-Louis Dupond (dupondje) wrote :

True :) Somebody has a ppa with new version?

Benjamin Drung (bdrung) wrote :

I am working on getting 1.1.10 into the archive (Ubuntu 11.10). 1.1.10 does not meet the SRU requirements. I can backport the pulse rewrite to 11.04 (natty).

Changed in pulseaudio (Ubuntu Natty):
status: New → Invalid
Changed in vlc (Ubuntu Natty):
importance: Undecided → High
Changed in vlc (Ubuntu Natty):
status: New → Confirmed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package vlc - 1.1.10-1ubuntu1

---------------
vlc (1.1.10-1ubuntu1) oneiric; urgency=low

  * Merge from Debian unstable, remaining changes:
    - build and install the libx264 plugin

vlc (1.1.10-1) unstable; urgency=high

  [ Benjamin Drung ]
  * New upstream release.
    - Security: Fix XSPF integer overflow (CVE-2011-2194) (LP: #795410)
    - Improve .desktop file:
      - Add smb as supported protocol (Closes: #622879, LP: #737192)
      - add video/webm to supported MIME formats (LP: #769463)
    - Fix libdvdread errors while playing ogg files (Closes: #622935)
    - Support three channels in pulseaudio output plugin (LP: 743478)
    - PulseAudio output re-written due to unstability of the current one
      (LP: #743323)
    - Fix crashes (LP: #754497, #785979)
    - Qt: allow drag and drop of any URL, not just a local file (LP: #664030)
    - Fix libvlcplugin.so: undefined symbol: NPP_Initialize (LP: #722690)
  * Refresh patches.
  * Drop as-needed patch due to autoreconf run.
  * Backport PulseAudio build fix.
  * Add GNOME MIME types for Ogg Vorbis and Ogg Theora (Closes: #629619).
  * Mention potcast support in package description (Closes: #488771).

  [ Reinhard Tartler ]
  * run autoreconf on the buildds
  * Weaken dependencies on libschroedinger
 -- Benjamin Drung <email address hidden> Sat, 11 Jun 2011 19:56:27 +0200

Changed in vlc (Ubuntu):
status: Confirmed → Fix Released
Benjamin Drung (bdrung) wrote :

I prepared a fix for Ubuntu 11.04 (natty) in my PPA [1]. Please install it from there and don't forget to disable my PPA after the VLC upgrade! Please report back, if it fixes the memory leak and if it introduce new issues.

[1] https://launchpad.net/~bdrung/+archive/ppa

Stefan Nagy (stefan-nagy) wrote :

Works for me :) Great – thanks!!

Benjamin Drung (bdrung) wrote :
zniavre (zniavre2048-gmail) wrote :

i got the same bug after today upgrading in natty 11.04

Benjamin Drung (bdrung) wrote :

@zniavre: That's because it not yet fixed in natty. Can you please test the package from my PPA (see comment #75)?

lipstick (sinanaykut-gmail) wrote :

There is still an unsolved issue with ram files. After listening them
for a while, the audio is just stopped being streamed.

http://www.bbc.co.uk/worldservice/learningenglish/work/handy/newmedia/intro.ram

After around 1:30, vlc is not playing the file anymore.

Thanks.

2011/6/14 Benjamin Drung <email address hidden>:
> @zniavre: That's because it not yet fixed in natty. Can you please test
> the package from my PPA (see comment #75)?
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (794425).
> https://bugs.launchpad.net/bugs/743323
>
> Title:
>  vlc memory leak
>
> Status in VLC media player:
>  Fix Released
> Status in “pulseaudio” package in Ubuntu:
>  Invalid
> Status in “vlc” package in Ubuntu:
>  Fix Released
> Status in “pulseaudio” source package in Natty:
>  Invalid
> Status in “vlc” source package in Natty:
>  Confirmed
>
> Bug description:
>  Binary package hint: vlc
>
>  While watching a macromedia flash video, when i paused the video and
>  restarted it, I've got a memory leak in vlc (the process vlc takes the
>  whole memory in 10 secondes).
>
>   Also, in some case, when the process vlc was killed by the kernel and
>  when i retrieve the control of my pc, compiz was disabled while it was
>  enabled before the memory leak.
>
>  ProblemType: Bug
>  DistroRelease: Ubuntu 10.04
>  Package: vlc 1.0.6-1ubuntu1.5
>  ProcVersionSignature: Ubuntu 2.6.32-30.59-generic 2.6.32.29+drm33.13
>  Uname: Linux 2.6.32-30-generic x86_64
>  NonfreeKernelModules: fglrx
>  Architecture: amd64
>  Date: Sat Mar 26 22:23:17 2011
>  InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Release Candidate amd64 (20100419.1)
>  ProcEnviron:
>   LANG=fr_FR.utf8
>   SHELL=/bin/bash
>  SourcePackage: vlc
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/vlc/+bug/743323/+subscriptions
>

--
twitter.com/sinan_aykut

Andreas Preikschat (googol) wrote :

@Benjamin Drung:
The PPA version works fine here.

Benjamin Drung (bdrung) wrote :

@lipstick: I can reproduce your problem with this ram file. When using ALSA directly, the playback sounds weird after around 1:30. Therefore it's totally unrelated to this memory leak. Please file a new bug report for it.

lipstick (sinanaykut-gmail) wrote :

Actually, I did but a guy linked it to this bug so i hoped it would be
fixed with it, but thats alright. Anyway, I tried the same ram file on
windows with VLC but it was working.

2011/6/14 Benjamin Drung <email address hidden>:
> @lipstick: I can reproduce your problem with this ram file. When using
> ALSA directly, the playback sounds weird after around 1:30. Therefore
> it's totally unrelated to this memory leak. Please file a new bug report
> for it.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (794425).
> https://bugs.launchpad.net/bugs/743323
>
> Title:
>  vlc memory leak
>
> Status in VLC media player:
>  Fix Released
> Status in “pulseaudio” package in Ubuntu:
>  Invalid
> Status in “vlc” package in Ubuntu:
>  Fix Released
> Status in “pulseaudio” source package in Natty:
>  Invalid
> Status in “vlc” source package in Natty:
>  Confirmed
>
> Bug description:
>  Binary package hint: vlc
>
>  While watching a macromedia flash video, when i paused the video and
>  restarted it, I've got a memory leak in vlc (the process vlc takes the
>  whole memory in 10 secondes).
>
>   Also, in some case, when the process vlc was killed by the kernel and
>  when i retrieve the control of my pc, compiz was disabled while it was
>  enabled before the memory leak.
>
>  ProblemType: Bug
>  DistroRelease: Ubuntu 10.04
>  Package: vlc 1.0.6-1ubuntu1.5
>  ProcVersionSignature: Ubuntu 2.6.32-30.59-generic 2.6.32.29+drm33.13
>  Uname: Linux 2.6.32-30-generic x86_64
>  NonfreeKernelModules: fglrx
>  Architecture: amd64
>  Date: Sat Mar 26 22:23:17 2011
>  InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Release Candidate amd64 (20100419.1)
>  ProcEnviron:
>   LANG=fr_FR.utf8
>   SHELL=/bin/bash
>  SourcePackage: vlc
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/vlc/+bug/743323/+subscriptions
>

--
twitter.com/sinan_aykut

Benjamin Drung (bdrung) wrote :

I unlinked bug #794425.

hadrons123 (piruthiviraj) wrote :

still no audio sync in any of these versions but the memory leaks looks to have disappeared.
i tried this 1:
 1.1.9 PPA of B drung.

2:for 1.1.10 PPA

sudo add-apt-repository ppa:unixmen-com/vlc

sudo apt-get update
sudo apt-get install vlc mozilla-plugin-vlc vlc-plugin-pulse

3: for 1.2 PPA

sudo add-apt-repository ppa:videolan/master-daily
sudo apt-get update
sudo apt-get upgrade

sync looks like a bigger issue.

Accepted vlc into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in vlc (Ubuntu Natty):
status: Confirmed → Fix Committed
tags: added: verification-needed
Felix Geyer (debfx) wrote :

After the update the audio is often out of sync but maybe that's worth trading for the memory leak.

I downgraded since the memory leak does not affect that much if you do not leave the video on longer than needed. Audio is half of the show when watching series and movies.

It shouldn't be to hard to see where this patch affects the audio?

Rémi Denis-Courmont (rdenis) wrote :

It's well known why sync is bad. That's not really the problem. The problem is to find someone who is able to sync PulseAudio with VLC. I tried and could not make sense of it. Someone else is going to have to do that if it matters.

I'm still running VLC 1.1.9 on Natty, so I followed the suggestions from comments #47 and #57 and switched to the ALSA audio plugin, explicitly selecting a non-default sound device. Unfortunately, this doesn't fix the problem on my machine. The memory leak seems to occur much more infrequently, but it does still occur from time to time. Don't know if it's just me, but it seems PULSE audio is not the only culprit here. ;)

I'm running Kubuntu 11.04 64bit on a Thinkpad T520.

Is there anything I can provide to help you hunting down this bug? As mentioned above, the problem occurs very infrequently, so getting logs etc. might take some time. But if it helps, I'd be happy to give it a try...

Rémi Denis-Courmont (rdenis) wrote :

As far as I know, unless you set the "aout" vlcrc parameter expliticitly to "alsa,none", VLC will fall back to whatever it can if/when ALSA refuses to work. And whatever it can means PulseAudio on Ubuntu, if the selected ALSA output device is busy (or non-existent).

I have never heard of the memory leak occurring with the decade-old VLC ALSA output. You can check which audio output plugin is really used from Tools -> Messages -> Modules tree

Benjamin Drung (bdrung) wrote :

@Axel: Can you install vlc from natty-proposed (see comment #86)?

@Rémi: According to the Modules Tree dialog, VLC is using ALSA.
@Benjamin: Done. I'll get back to you guys if I somehow manage to reproduce the memory leak.

Thanks,

Axel

Max (maxmax) wrote :

$ vlc --version
VLC media player 1.1.9 The Luggage (revision exported)
VLC version 1.1.9 The Luggage (exported)
Compiled by buildd on zirconium.buildd (Jun 12 2011 03:10:42)
Compiler: gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)

System 11.04 (2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux)

Fully patched with all stable patches.

Compiz disabled

This is very easy to reproduce with a file of type: "MPEG sequence, v2, program multiplex"

Howto reproduce: just start playing a file of the type mentioned above, then during playing click with the mouse on random places on the progress bar so it continues to play from there, then hit pause (space bar), if no freeze try clicking the progress bar and pause a few more times...
It gets this memory leak/system freeze in less then 20 seconds.

Max (maxmax) wrote :

When I follow #86 the problem is resolved!

It updated the vlc packages from 1.1.9-1ubuntu1.1 to 1.1.9-1ubuntu1.2

Small side note:
When I press pause now the audio continues to play for one more second, and when I press resume the first 1 or 2 seconds of audio is played twice.

I suggest to open a new bug report for that, IF to report it at all.

I have followed #86. Test and feedback:

No VLC 1.1.9-1ubuntu1.2 crash happened while playing an MP4 file. But after Stop playback the Play button doesn't work.

Source: VLC crashed playing an MP4 file https://bugs.launchpad.net/ubuntu/+source/vlc/+bug/799220

Tim, would you explain what you mean by "not leave the video on longer
than needed"? I have had this memory-hoarding problem while simply
watching a video file. It wasn't left on longer than needed, it
failed to work as long as needed.

On Sat, Jun 18, 2011 at 03:49, Tim Kornhammar <email address hidden> wrote:
> I downgraded since the memory leak does not affect that much if you do
> not leave the video on longer than needed. Audio is half of the show
> when watching series and movies.
>
> It shouldn't be to hard to see where this patch affects the audio?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/743323
>
> Title:
>  vlc memory leak
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/vlc/+bug/743323/+subscriptions
>

Maybe I'm lycky bit I need to leave vlc and a 1gb video on for maybe 14-15 hours before any problems occur.

Johan Walles (walles) wrote :

To work around this you can play with the kernel's overcommit settings:

sudo bash
echo 100 > /proc/sys/vm/overcommit_ratio
echo 2 > /proc/sys/vm/overcommit_memory
exit
vlc

Now, when vlc runs amok, a memory allocation will fail and vlc will crash.

Note that messing with the overcommit settings can crash your machine (until you reboot) and the 100 value may need tuning. If processes start crashing before you even start VLC, raise it by 50. If your machine goes down rather than just VLC crashing, lower it by 50.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package vlc - 1.1.9-1ubuntu1.2

---------------
vlc (1.1.9-1ubuntu1.2) natty-proposed; urgency=low

  * Backport PulseAudio output plugin rewrite to fix memory leak. (LP: #743323)
  * ASX: fix NULL derefence (LP: #785979)
  * Qt: undo the FSC/KDE workaround (LP: #774581)
  * Add Firefox 4 compatibility (LP: #722690)
 -- Benjamin Drung <email address hidden> Tue, 14 Jun 2011 03:04:10 +0200

Changed in vlc (Ubuntu Natty):
status: Fix Committed → Fix Released
Changed in vlc (Ubuntu):
assignee: nobody → Heru Herdianto (herdiantoheru-yahoo)
Changed in pulseaudio (Ubuntu):
assignee: nobody → Heru Herdianto (herdiantoheru-yahoo)
Changed in pulseaudio (Ubuntu Natty):
assignee: nobody → Heru Herdianto (herdiantoheru-yahoo)
Changed in vlc (Ubuntu Natty):
assignee: nobody → Heru Herdianto (herdiantoheru-yahoo)
papukaija (papukaija) on 2011-06-28
Changed in vlc (Ubuntu Natty):
assignee: Heru Herdianto (herdiantoheru-yahoo) → papukaija (papukaija)
Changed in vlc (Ubuntu):
assignee: Heru Herdianto (herdiantoheru-yahoo) → papukaija (papukaija)
Changed in pulseaudio (Ubuntu Natty):
assignee: Heru Herdianto (herdiantoheru-yahoo) → papukaija (papukaija)
Changed in pulseaudio (Ubuntu):
assignee: Heru Herdianto (herdiantoheru-yahoo) → papukaija (papukaija)
assignee: papukaija (papukaija) → nobody
Changed in pulseaudio (Ubuntu Natty):
assignee: papukaija (papukaija) → nobody
Changed in vlc (Ubuntu):
assignee: papukaija (papukaija) → nobody
Changed in vlc (Ubuntu Natty):
assignee: papukaija (papukaija) → nobody
KnightMB (knightmb) wrote :

I see this bug was marked fix already, but I thought I would add this in case it was relevant later on.

My system had the same issue where it would eat all the RAM and then explode after a while. This happened while just playing audio files (mp3 or ogg)

What I've always noticed was this RAM leak occurs when it's "buffering". I play audio files over a NFS share and when the NFS server is asleep, you play an audio file, VLC has to wait to buffer. While in the "buffering" state, the RAM usage and CPU will max out. Once th NFS starts streaming it goes away and the file plays. But sometimes when you are moving around on the audio file (using the cursor to skip around), it always buffers and sometimes that's when it would go into a RAM leak state.

My system specs were Mandriva 2010.0 x64 + 16GB RAM, running VLC 1.0.4 (yeah, old version, but it appears the bug has been around for a while)

So while it might be audio plugin related, I wonder if something in the buffer code was also causing an issue or if will be an issue in future versions to be triggered in some unknown way.

Johan Walles (walles) wrote :

Hi there!

When can we expect this to get fixed in the Lucid LTS release?

Watching a DVD on Lucid currently leads to having to power cycle the system about once or twice per movie. It also happens with both ALSA and Pulse audio drivers.

  Regards //Johan

Rémi Denis-Courmont (rdenis) wrote :
Download full text (5.1 KiB)

I managed to reproduce the problem today (using Ubuntu 11.04 _without_ natty-updates). It seems the root cause may be a bug in ALSA after all. PulseAudio complained in syslog:

Jul 11 11:47:16 leon pulseaudio[1810]: alsa-util.c: snd_pcm_avail() a retourné une valeur qui est exceptionnellement large : 2922048 octets (15219 ms).
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: Il s'agit très probablement d'un bogue dans le pilote ALSA « snd_hda_intel ». Veuillez rapporter ce problème aux développeurs d'ALSA.
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: snd_pcm_dump():
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: Hardware PCM card 0 'HDA Intel' device 0 subdevice 0
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: Its setup is:
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: stream : PLAYBACK
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: access : MMAP_INTERLEAVED
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: format : S16_LE
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: subformat : STD
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: channels : 2
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: rate : 48000
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: exact rate : 48000 (48000/1)
Jul 11 11:49:31 leon pulseaudio[1810]: alsa-util.c: msbits : 16
Jul 11 11:49:46 leon pulseaudio[1810]: alsa-util.c: buffer_size : 96000
Jul 11 11:49:47 leon pulseaudio[1810]: alsa-util.c: period_size : 48000
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: period_time : 1000000
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: tstamp_mode : ENABLE
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: period_step : 1
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: avail_min : 95617
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: period_event : 0
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: start_threshold : -1
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: stop_threshold : 1572864000
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: silence_threshold: 0
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: silence_size : 0
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: boundary : 1572864000
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: appl_ptr : 394960
Jul 11 11:49:48 leon pulseaudio[1810]: alsa-util.c: hw_ptr : 1152000
Jul 11 11:50:10 leon pulseaudio[1810]: alsa-util.c: snd_pcm_delay() a retourné une valeur qui est exceptionnellement large : -42434976 octets (-221015 ms).
Jul 11 11:50:10 leon pulseaudio[1810]: alsa-util.c: Il s'agit très probablement d'un bogue dans le pilote ALSA « snd_hda_intel ». Veuillez rapporter ce problème aux développeurs d'ALSA.
Jul 11 11:50:10 leon pulseaudio[1810]: alsa-util.c: snd_pcm_dump():
Jul 11 11:50:10 leon pulseaudio[1810]: alsa-util.c: Hardware PCM card 0 'HDA Intel' device 0 subdevice 0
Jul 11 11:50:10 leon pulseaudio[1810]: alsa-util.c: Its setup is:
Jul 11 11:50:10 leon pulseaudio[1810]: alsa-util.c: stream : PLAYBACK
Jul 11 11:50:10 leon pulseaudio[1810]: alsa-util.c: access : MMAP_INTERLEAVED
Jul 11 11:50:11 leon pulse...

Read more...

1 comments hidden view all 110 comments
funicorn (funicorn) wrote :

Same here. VLC suddenly crashes and the whole system freezes leaving the hard drive madly working. Finally I have cold-reboot the linux kernel. Ubuntu seems to own a magic power to make every application a hardware killer.

What if the user is not present and the bad status lasts ? 30 minute of such full load state could have physically damaged the hard disk, and Ubuntu would be the notorious hard-drive killer again.

To funicorn:

Well, please don't dramatize so much. No application would do anything like you described - HW vendors are clever enough to test their drives to bear the load. Unless you use some really poorly assembled laptop which has overheating problems by itself.

08 сентября 2011, 13:41 от funicorn <email address hidden>:
>Same here. VLC suddenly crashes and the whole system freezes leaving the
>hard drive madly working. Finally I have cold-reboot the linux kernel.
>Ubuntu seems to own a magic power to make every application a hardware
>killer.
>
>What if the user is not present and the bad status lasts ? 30 minute of
>such full load state could have physically damaged the hard disk, and
>Ubuntu would be the notorious hard-drive killer again.
>
>--
>You received this bug notification because you are subscribed to a
>duplicate bug report (575460).
>https://bugs.launchpad.net/bugs/743323
>
>Title:
> vlc memory leak
>
>Status in VLC media player:
> Fix Released
>Status in “pulseaudio” package in Ubuntu:
> Invalid
>Status in “vlc” package in Ubuntu:
> Fix Released
>Status in “pulseaudio” source package in Natty:
> Invalid
>Status in “vlc” source package in Natty:
> Fix Released
>
>Bug description:
> Binary package hint: vlc
>
> While watching a macromedia flash video, when i paused the video and
> restarted it, I've got a memory leak in vlc (the process vlc takes the
> whole memory in 10 secondes).
>
> Also, in some case, when the process vlc was killed by the kernel and
> when i retrieve the control of my pc, compiz was disabled while it was
> enabled before the memory leak.
>
> ProblemType: Bug
> DistroRelease: Ubuntu 10.04
> Package: vlc 1.0.6-1ubuntu1.5
> ProcVersionSignature: Ubuntu 2.6.32-30.59-generic 2.6.32.29+drm33.13
> Uname: Linux 2.6.32-30-generic x86_64
> NonfreeKernelModules: fglrx
> Architecture: amd64
> Date: Sat Mar 26 22:23:17 2011
> InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Release Candidate amd64 (20100419.1)
> ProcEnviron:
> LANG=fr_FR.utf8
> SHELL=/bin/bash
> SourcePackage: vlc
>
>To manage notifications about this bug go to:
>https://bugs.launchpad.net/vlc/+bug/743323/+subscriptions
>
С наилучшими пожеланиями,
Григорий Речистов.
Best regards,
Grigory Rechistov

Rémi Denis-Courmont (rdenis) wrote :

The bug is fixed now, so I don't really get what you are ranting about.

It would certainly be nice if Ubuntu had a better QA for VLC. Then again, while that leaves much to be desired, it is far better than on practically any OS (except perhaps Gentoo and Debian). I can assure you that Microsoft and Apple don't do any QA for VLC on Windows and MacOS respectively, nor do the other commercial Linux distributions. And in my experience, Windows will crash much the same as Linux in case of intensive memory swapping.

Sure, there could be safety nets: a per-process memory size limit could be enforced by default, or the size of the swap could maybe be smaller, or the Linux elevators should deal with this kind of load better. But this is probably not the right venue to discuss this: this bug does not have visibility to the people who could potentially address this general memory starvation problem.

Johan Walles (walles) wrote :

Rémi, this is still a problem in Lucid.

sabraq (sabraq) wrote :

If you still want fix it in Lucid, you only need ppa lucid-bleed.

http://www.videolan.org/vlc/download-ubuntu.html

Displaying first 40 and last 40 comments. View all 110 comments or add a comment.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.