VLC uses excessive amounts of memory

About encoding, codec settings, muxers and filter usage
awj223

VLC uses excessive amounts of memory

Postby awj223 » 04 Apr 2005 18:23

I have noticed that VLC begins consuming excessive amounts of memory when being used as a streaming server (400 MB/hr) and does not free it until it shuts down.

System Setup:
Debian Sarge
vlc-0.8.1*
ffmpeg-0.4.9-pre1*
*Both compiled with options given on http://sourceforge.net/docman/display_d ... _id=127846

MythStreamTV comes with a script that launches vlc to do the streaming. From that point on, VLC begins consuming memory at the rate of approximately 400 MB/hr when run with the following options:

This is how said script calls VLC:
/usr/local/bin/vlc -I http --http-host=:8002 --sout-transcode-fps=$FPS
--sout-transcode-deinterlace $1 ":sout=#transcode{vcodec=$VCODEC,acodec=$ACODEC,
vb=$VB,ab=$AB,scale=$SIZE}:std{access=mmsh,mux=asfh,url=:8001}"

Now, I modified this script so that instead of launching VLC, it launches VLC under valgrind with the --trace-children=yes and --leak-check=full options set, and the following is a subset of the output given when the program terminated:

==23763== 7745360 bytes in 403 blocks are possibly lost in loss record 86 of 86
==23763== at 0x1B90459D: malloc (vg_replace_malloc.c:130)
==23763== by 0x806EC2C: __block_New (block.c:54)
==23763== by 0x1D2E78B5: ParseMPEGBlock (vlc_block.h:221)
==23763== by 0x1D2E6CA8: Packetize (mpegvideo.c:289)
==23763== by 0x808BB6D: DecoderDecode (decoder.c:599)
==23763== by 0x808E563: EsOutSend (es_out.c:765)
==23763== by 0x1D28BDE2: Demux (vlc_es_out.h:96)
==23763== by 0x8056CF6: Run (input.c:340)
==23763== by 0x1B933E50: pthread_start_thread (in /lib/libpthread-0.10.so)
==23763== by 0x1BC4A6E9: clone (in /lib/libc-2.3.2.so)

==23763== LEAK SUMMARY:
==23763== definitely lost: 96745 bytes in 13 blocks.
==23763== indirectly lost: 120 bytes in 10 blocks.
==23763== possibly lost: 7745360 bytes in 403 blocks.
==23763== still reachable: 770879 bytes in 5271 blocks.
==23763== suppressed: 0 bytes in 0 blocks.

I suspect there is either some sort of memory leak, or that VLC is simply storing and keeping pointers to a very large, and probably unnecessary, amount of memory.

awj223

Postby awj223 » 06 Apr 2005 03:52

Update: confirmed that the memory leak still exists with the latest snapshot that compiles with the above mentioned options without errors (vlc-snapshot-20050217)

xtophe
Big Cone-huna
Big Cone-huna
Posts: 1209
Joined: 24 Nov 2003 10:12
Location: Bristol, England

Postby xtophe » 06 Apr 2005 14:20

could you try with a more recent snapshot (20050405 by example)
Xtophe

awj223

Postby awj223 » 07 Apr 2005 08:48

could you try with a more recent snapshot (20050405 by example)
This snapshot (and the subsequent one, 20050406) do not compile, because the file modules/video_output/picture.h, which is included in modules/video_output/mosaic.c, is missing.

xtophe
Big Cone-huna
Big Cone-huna
Posts: 1209
Joined: 24 Nov 2003 10:12
Location: Bristol, England

Postby xtophe » 07 Apr 2005 10:07

Thanck you for this report.

It's fixed and will be in 8th snapshot ( migth even be in today snapshot but it's a question of minute )
Xtophe

awj223

Postby awj223 » 10 Apr 2005 05:23

Thanck you for this report.

It's fixed and will be in 8th snapshot ( migth even be in today snapshot but it's a question of minute )
The 20050408 snapshot compiles, but the memory leak is still present.

chew.z

Postby chew.z » 12 Apr 2005 12:30

It's the same from me.

I'm using Debian sid, with nightly builds binary from:

deb http://vthr.via.ecp.fr/~videolan/build/sid experimental main

Bye

apv
New Cone
New Cone
Posts: 2
Joined: 10 Jun 2005 20:20

I see this even with VLC client

Postby apv » 15 Jun 2005 18:31

I see this problem even when VLC is acting as a multicast video client. I've seen this on Win 2000 and XP as well with VLC version 0.8.1. Is there a patch I can apply?

bzImage

Postby bzImage » 31 Mar 2006 05:38

I keep seeing this with knoppmyth streaming.. eventualy oom-killer start killing processes on the system because of the lack of ram..

knoppmyth R5B7 comes with VLC 0.8.1..

Is this fixed in any other release ?

Umberto
Blank Cone
Blank Cone
Posts: 28
Joined: 23 Aug 2006 07:41

Postby Umberto » 28 Aug 2006 14:14

I have the same problem.
I use VLC for only receiving audio.
it's a simple http stream (AAC or MP3) and I uses ALSA to play the sound.

I used Slackware as distro, but I'm building a Debian right now to see if the problem still excists.

I tried several options, even when I start VLC very basic
vlc --aout alsa --alsadev hw:1,1 and I start a http stream it starts eating up memory.

ggunners
Blank Cone
Blank Cone
Posts: 23
Joined: 29 Nov 2005 18:40
Location: Northern Virginia
Contact:

Postby ggunners » 07 Sep 2006 20:07

Just a question. Are you running VLC in a window? If so, is it maximized or minimized.

For Windows, minimizing the VLC app stops the memory creep. I'm running VLC on Win2K, 2 instances, one for a TV Tuner and another for a web cam, with both minimized, I can run this computer for weeks at a time without filling up memory or requiring a reboot.

Both streams are multicast UDP.

-- ggunners

JaMa
New Cone
New Cone
Posts: 4
Joined: 12 Sep 2006 08:33

Memory leaks still exists

Postby JaMa » 12 Sep 2006 08:39

I'm running streaming server on Fedora Core, vlc is rebuilded from srpm without most options (only CLI interface with DVB and VLM needed)

Code: Select all

rpmbuild -bb SPECS/videolan-client.spec --target i686 --without hal --without avahi --without a52 --without aa --without alsa --without arts --without caca --without cddb --without cdio --without daap --without dca --without dvdnav --without dvdread --without esd --without faad2 --without ffmpeg --without flac --without freedesktop --without fribidi --without glx --without gnomevfs --without hal --without id3tag --without lirc --without live --without mad --without mkv --without modplug --without mpcdec --without mpeg2dec --without ogg --without pvr --without sdl --without slp --without smb --without speex --without theora --without v4l --without vcd --without vorbis --without wxwidgets --without x264 --without xosd --with dvb --with vlm
And running in VLM mode (streaming about 10 DVB stations with UDP multicast)

Sometimes it consumes about 40MB/hour and I have to restart vlc (watchdog checks memory every 5min).

I'll run it with valgring to see where the memory is.

JaMa
New Cone
New Cone
Posts: 4
Joined: 12 Sep 2006 08:33

Re: Memory leaks still exists

Postby JaMa » 12 Sep 2006 10:17

I'll run it with valgring to see where the memory is.
It's only libdvbpsi problem?
==15148== 248 (12 direct, 236 indirect) bytes in 1 blocks are definitely lost in loss record 43 of 57
==15148== at 0x40204C2: realloc (vg_replace_malloc.c:306)
==15148== by 0x805B51E: (within /usr/bin/vlc)
==15148==
==15148==
==15148== 288 (24 direct, 264 indirect) bytes in 2 blocks are definitely lost in loss record 46 of 57
==15148== at 0x40203C6: malloc (vg_replace_malloc.c:149)
==15148== by 0x80A7576: (within /usr/bin/vlc)
==15148==
==15148==
==15148== 12,168 (440 direct, 11,728 indirect) bytes in 22 blocks are definitely lost in loss record 51 of 57
==15148== at 0x40203C6: malloc (vg_replace_malloc.c:149)
==15148== by 0x40FB122: dvbpsi_GatherPMTSections (in /usr/lib/libdvbpsi.so.4.0.0)
==15148== by 0x40F9CC2: dvbpsi_PushPacket (in /usr/lib/libdvbpsi.so.4.0.0)
==15148== by 0x7B3483F: ???
==15148==
==15148==
==15148== 6,071 (960 direct, 5,111 indirect) bytes in 2 blocks are definitely lost in loss record 53 of 57
==15148== at 0x40203C6: malloc (vg_replace_malloc.c:149)
==15148== by 0x80A69C3: (within /usr/bin/vlc)
==15148==
==15148== LEAK SUMMARY:
==15148== definitely lost: 1,807 bytes in 49 blocks.
==15148== indirectly lost: 17,603 bytes in 633 blocks.
==15148== possibly lost: 0 bytes in 0 blocks.
==15148== still reachable: 4,261 bytes in 19 blocks.
==15148== suppressed: 0 bytes in 0 blocks.
==15148== Reachable blocks (those to which a pointer was found) are not shown.

tong.lin
New Cone
New Cone
Posts: 1
Joined: 19 Sep 2006 17:25

Re: Memory leaks still exists

Postby tong.lin » 19 Sep 2006 21:23

Hi all:

I am kind of having the same problem on a Windows XP system.

While the VLC player is playing, the paging File increases for some reason and VLC palyer does not tell Windows it does not. Eventually the player crashes on the system.

My plan to was playing the VLC player at least 100 hours straight, not sure if VLC player is designed to that or not.

I thought maybe something was wrong on system, so I only run with VLC and nothing else, but Paging File keeps increasing and reach the limit and crashed.

Does anyone has any way to get around that problem, other than increase the swap file's size to infinite. ^_^

Thank you.

Tong Lin
tong.tl@hotmail.com

JaMa
New Cone
New Cone
Posts: 4
Joined: 12 Sep 2006 08:33

Re: Memory leaks still exists

Postby JaMa » 20 Sep 2006 08:35

Does anyone has any way to get around that problem, other than increase the swap file's size to infinite. ^_^
I have no idea how to script it on windows, but on linux I have script in cron which checks mem usage of vlc and if it's over 20% (system has 3GB RAM) than script restart vlc service (service for running vlc non-interactively in vlm mode).


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 25 guests