VLC CPU and memory consumption after long time playing

*nix specific usage questions
kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

VLC CPU and memory consumption after long time playing

Postby kotao_78 » 15 Aug 2007 16:17

HI ALL,

I encounter a VLC problem on CPU and memory consumption,

I used VLC play a mp3 repeatedly for about 12 hours , at first the CPU consumption is about 7% , memory consumption is about 13% , after 12 hours playing , the VLC CPU consumption and memory consumption increase to 12%~ 15% and 17% ~20%.

Is it normal ? I mean the CPU and memory consumption did not return to first time playing .
If not , can anybody point out what's the problem is or how to investigate the problem? :shock:

Best Regards,
Ke Tao
Last edited by kotao_78 on 17 Aug 2007 04:55, edited 1 time in total.

kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

Re: VLC playing CPU and memory consumption

Postby kotao_78 » 16 Aug 2007 10:12

The testing version of VLC is 0.85

funman
Developer
Developer
Posts: 1159
Joined: 03 Sep 2006 04:03
VLC version: master
Operating System: All of them
Location: Lost, please help me

Re: VLC playing CPU and memory consumption

Postby funman » 16 Aug 2007 11:13

please try with uptodate vlc, 0.8.6c

alternatively, try with a development nightly build trunk version ( http://nightlies.videolan.org )

kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

Re: VLC playing CPU and memory consumption

Postby kotao_78 » 17 Aug 2007 04:48

0.86's CPU consumption is lower than 0.85, but also increase slowly after long time playing.
From 4.6% to 10% after 15 hours playing.

kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

Re: VLC CPU and memory consumption after long time playing

Postby kotao_78 » 20 Aug 2007 05:32

Can anybody point out or suggest how to investigate this issue?
Maybe this reason is one of the following,
1.VLC internal error , some running thread do hard working after long time playing?
2.Third party library error , it cost too much CPU resource at that time?
3.System error , it running slow after long time running??
....

kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

Re: VLC CPU and memory consumption after long time playing

Postby kotao_78 » 20 Aug 2007 08:53

The starting command line is,

./vlc --plugin-path=/root/vlc/lib/modules --aout alsa --alsadev "hw:0,0" -I rc --file-caching 600 --cdda-caching 600 --http-caching 1200 --file-logging -vvvv --logfile /var/vlc.log --logmode text /root/html/dreams.mp3 -L

kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

Re: VLC CPU and memory consumption after long time playing

Postby kotao_78 » 23 Aug 2007 09:53

This is the sar log of VLC long time playing,
please refer to the link:http://www.esnips.com/doc/f6e24adc-4960 ... log-of-vlc

kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

Re: VLC CPU and memory consumption after long time playing

Postby kotao_78 » 05 Sep 2007 12:29

Is it caused by too many malloc memory? I saw there a lots of malloc in fifo block and data block when playing. CPU is busy manage the memory after a long time playing.

kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

Re: VLC CPU and memory consumption after long time playing

Postby kotao_78 » 08 Sep 2007 03:49

I finally find the reason. It's stat module cause this issue.

Gujs
Blank Cone
Blank Cone
Posts: 74
Joined: 22 Oct 2004 19:28

Re: VLC CPU and memory consumption after long time playing

Postby Gujs » 10 Sep 2007 10:18

I have the same problem when streaming dvb-s channels. I found out that vlc memory and cpu usage are rising when my channel for dvb-s card become scrambled. And when it is free again memory usage stays at the number when channel became free again. It doesn't fall back to normal. When this repeats a number of times, vlc uses all memory and swap!

I am using vlc-trunk, and I didn't find any stat module in it!

funman
Developer
Developer
Posts: 1159
Joined: 03 Sep 2006 04:03
VLC version: master
Operating System: All of them
Location: Lost, please help me

Re: VLC CPU and memory consumption after long time playing

Postby funman » 10 Sep 2007 12:46

use --no-stats

kotao_78 could you open a ticket on that issue on trac.videolan.org/vlc so we don't forget about it ?

kusamochi
New Cone
New Cone
Posts: 2
Joined: 10 Sep 2007 14:22
VLC version: 0.8.6c
Operating System: Debian 4.0r1

Re: VLC CPU and memory consumption after long time playing

Postby kusamochi » 10 Sep 2007 14:33

Hey kotao_78,

I have the same problem with the CPU consumption after playing MPEG2 on local and streaming for about 9 hours. The problem seems to occur faster and more noticeable when more frequent of switching files in a play list. I will try funman's --no-stats flag and see what happen, thx guys for finding this out.

mochi

Gujs
Blank Cone
Blank Cone
Posts: 74
Joined: 22 Oct 2004 19:28

Re: VLC CPU and memory consumption after long time playing

Postby Gujs » 11 Sep 2007 08:29

Argument --no-stats doesn't help in my case. When one of streaming channels become scrambled, vlc starts to consume more and more memory, until system gets really slow. I tested both versions and I came to conclusion that 0.8.6c is a lot better than 0.9.0, but still not without memory rising feature :D .

Can it have something with libdvbpsi, because I compiled vlc with static linking to latest trunk of libdvbpsi.

Thanks!

kusamochi
New Cone
New Cone
Posts: 2
Joined: 10 Sep 2007 14:22
VLC version: 0.8.6c
Operating System: Debian 4.0r1

Re: VLC CPU and memory consumption after long time playing

Postby kusamochi » 11 Sep 2007 11:56

Dear kotao_78,

Today I had 4 machines running vlc 0.8.6c from 8am for about 10 hours now, 1 as streaming, 2 watching stream and 1 local playback. with --no-stats the cpu problem is gone and stays normal :lol:, without --no-stats I hardly run over 9 hours so I assume it is solved, thank you so much for the info.

And Gujs sorry --no-stats didn't help in your case :( let you know if I can find anything to help

mochi

Gujs
Blank Cone
Blank Cone
Posts: 74
Joined: 22 Oct 2004 19:28

Re: VLC CPU and memory consumption after long time playing

Postby Gujs » 11 Sep 2007 12:57

Hi,

I was using vlc through JVLC. Now I tried vlc in command line and the problem is gone. Now I don't know if problem is in vlc library or in jvlc library.

If I would only know how to use vlc library in C to start dvb streaming and test this option to!

kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

Re: VLC CPU and memory consumption after long time playing

Postby kotao_78 » 11 Sep 2007 15:02

Dear All,

Let me detail why VLC(0.85 & 0.86) CPU consumption will increase after long time playing.

Please check stats.c(vlc/src/stats.c) GetCounter function,
I found "p_handler->i_counters" will be plus 10 after 1 song played , that implies the loop will take more time more and more , but unfortunately , GetCounter function is called by __stats_Update and __stats_Get , after long time playing , it will cost a lots of CPU at that loop.

Later I'd checked stats module is enable by libvlc.c:688(v0.86).

Anyway , I will raise a trac for it and wish it can be fixed next release.Thanks you all.

Ke Tao

funman
Developer
Developer
Posts: 1159
Joined: 03 Sep 2006 04:03
VLC version: master
Operating System: All of them
Location: Lost, please help me

Re: VLC CPU and memory consumption after long time playing

Postby funman » 11 Sep 2007 17:49

i don't get it, you mean p_handler->i_counters will increase indefinitely when playing for hours ?

and that doesn't explain memory consumption :(

thanks for the report anyway :)

kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

Re: VLC CPU and memory consumption after long time playing

Postby kotao_78 » 12 Sep 2007 04:02

Yes , p_handler->i_counters will increase continuously when playing for long time , at first its value is n , after one song played , its value changed to n+10 and .......

And the "i_index" variable will be more large in the "GetCounter" function , that implies the loop will take more time to get the index.
I think will should put the index at top of the array , not at tail.

Anyway , I suggest we should disable "stats" module as default , actually I didn't know how to use it :lol: .
i don't get it, you mean p_handler->i_counters will increase indefinitely when playing for hours ?

and that doesn't explain memory consumption :(

thanks for the report anyway :)

th0r
New Cone
New Cone
Posts: 3
Joined: 17 Sep 2007 17:28

Re: VLC CPU and memory consumption after long time playing

Postby th0r » 28 Sep 2007 02:22

All I can say (without logging at this point as I am using the ActiveX control in a HTML page) is, I am using Icecast to stream various music videos in ogg format, after each video has played and the next one has loaded, memory consumption grows by about 3/4 MB once a new video is played. The Icecast server has about 25 videos that repeat themselves. So after a few hours of playback, that's it?!?!?!

This surely isn't right. In the end my client machine actually runs out of memory and grinds to a halt.

But on the up side.... VLC is one of the best players that I have come across :D

VLC 0.8.6c (WIndows)

kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

Re: VLC CPU and memory consumption after long time playing

Postby kotao_78 » 20 Sep 2009 04:27

All I can say (without logging at this point as I am using the ActiveX control in a HTML page) is, I am using Icecast to stream various music videos in ogg format, after each video has played and the next one has loaded, memory consumption grows by about 3/4 MB once a new video is played. The Icecast server has about 25 videos that repeat themselves. So after a few hours of playback, that's it?!?!?!

This surely isn't right. In the end my client machine actually runs out of memory and grinds to a halt.

But on the up side.... VLC is one of the best players that I have come across :D

VLC 0.8.6c (WIndows)
see my response before.

ccastro
Blank Cone
Blank Cone
Posts: 13
Joined: 12 May 2008 23:13

Re: VLC CPU and memory consumption after long time playing

Postby ccastro » 26 Jan 2010 17:23

I have a couple Ubuntu servers streaming video from a dvb adapter 24/7, and one of them freeze a few days ago, trying to discover why i found that vlc use all the ram and swap until colapse (http://pastebin.com/pastebin.php?dl=m59288c2c)

Now looking the graps of the other servers i take notice that it happend there too in diferent time, but luckely it release some memory after a day!! :S (http://img638.imageshack.us/img638/3199 ... sunris.png)

any help would be apriciated.


11:19:35 up 56 days, 21:05, 1 user, load average: 0.12, 0.17, 0.17
Linux ATSC-DECO-4 2.6.27-7-server #1 SMP Fri Oct 24 07:20:47 UTC 2008 x86_64 GNU/Linux
VLC media player 0.8.6e Janus
0b:01.2 Multimedia controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] (rev 05)

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

Re: VLC CPU and memory consumption after long time playing

Postby Rémi Denis-Courmont » 26 Jan 2010 17:47

VLC 0.8.6 has not been maintained for a long time. All calls for willing maintainers have gone unresponded, so don't expect any help.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

ccastro
Blank Cone
Blank Cone
Posts: 13
Joined: 12 May 2008 23:13

Re: VLC CPU and memory consumption after long time playing

Postby ccastro » 13 Aug 2010 19:02

Im using vlc 1.0.5 now and the problem persist, after a week suddendly vlc uses all the swap and the system crash. Im using it to transmit HD video streams to igmp routers.

Linux BBD-5 2.6.27-7-server #1 SMP Fri Oct 24 07:20:47 UTC 2008 x86_64 GNU/Linux
VLC media player 1.0.5 Goldeneye
8 x pcHDTV HD-5500 Multimedia controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] (rev 05)
Mem: 4046184k total
Intel(R) Core(TM)2 Duo CPU E6400 @ 2.13GHz

kotao_78
Blank Cone
Blank Cone
Posts: 86
Joined: 29 Jul 2006 09:46
Location: Zhuhai,China

Re: VLC CPU and memory consumption after long time playing

Postby kotao_78 » 14 Aug 2010 14:31

You just disable stats module will be OK.

ccastro
Blank Cone
Blank Cone
Posts: 13
Joined: 12 May 2008 23:13

Re: VLC CPU and memory consumption after long time playing

Postby ccastro » 16 Aug 2010 17:29

im looking at "configure" script and i dont see any stats module, can u give any hint?

Thanks


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 8 guests