Page 1 of 1

huge memory leak

Posted: 27 Sep 2010 17:36
by zdahAli
I am using vlc 1.1.3 on snow leopard. I just had a huge memory leak while playing mp3 ( more than 4 Go of virtual memory), and the amount was growing till my hard drive was full. I don't think this is normal ...

Re: huge memory leak

Posted: 28 Sep 2010 00:20
by Jean-Baptiste Kempf
Local files?

Re: huge memory leak

Posted: 28 Sep 2010 12:24
by zdahAli
yes

Re: huge memory leak

Posted: 05 Oct 2010 00:32
by fkuehne
Does resetting VLC's preferences have any effect? (To do so delete both a folder called "VLC" and a file named "org.videolan.vlc.plist" in ~/Library/Preferences.)

Re: huge memory leak

Posted: 28 Oct 2010 20:33
by VlcAwesome
I too have this problem of a huge "Inactive" memory leak not being released during playback nor upon quitting VLC.
I am running 1.1.3 on Snow Leopard 10.6.4 on a mostly stock core i5 iMac from 2010 (has Xcode + macports ghostscript + avidemux + handbrake).
I tried the dev suggestion of deleting VLC preferences. This had no effect.

To be clear, whenever I play (not pause) an x264 video inside an mkv container or an XviD inside an avi, my Inactive and Used Memory
as displayed in Activity Monitor slowly increase until my system runs completely out of Free Memory, and I end up swapping after watching
a film or two. Active Memory remains constant, and so does Wired. When I pause or stop the video, the memory stops being used up.

Any ideas? I really appreciate all your work on this software. It's really awesome.

EDIT: After reading thru some apple docs on memory, like this one:
http://developer.apple.com/library/mac/ ... emory.html
I found that memory mapping will eat up inactive memory, and that the system should use the inactive memory when it needs it
rather than swapping. Well mine just uses all 8 GB of ram. This seemed like an Apple problem the more I read.

But this made me think about VLC's memory map option. What if I disabled the express usage of memory mapping?
So I turned off my Input Codecs -> Access Modules -> MMap -> Use file memory mapping, and now my system uses
Active memory during playback not Inactive memory. The Active memory gets released upon quitting VLC as I figured
it should.

So I guess I don't have a problem per se. It might even be normal behavior.

Re: huge memory leak

Posted: 05 Nov 2010 07:08
by Entropy
You're right. VLC chews through free memory VERY quickly. After I'm done watching a movie my system is almost unusable. The developers need to code VLC so doesn't it doesn't make OS X catch all of the data... Quicktime does not have this problem.

Re: huge memory leak

Posted: 18 Nov 2010 13:18
by roger jonsson
But this made me think about VLC's memory map option. What if I disabled the express usage of memory mapping?
So I turned off my Input Codecs -> Access Modules -> MMap -> Use file memory mapping, and now my system uses
Active memory during playback not Inactive memory. The Active memory gets released upon quitting VLC as I figured
it should.

So I guess I don't have a problem per se. It might even be normal behavior.
THANK YOU! WHAT A RELEIF! :D
Even better, I just played a dvd and it didn't even chew away the free memory as it played.

The "memory map" function should come disabled and with a big warning when trying to turn it on. -It is now turned off and it will stay turned off!!!

Re: huge memory leak

Posted: 22 Nov 2010 08:58
by Entropy
But this made me think about VLC's memory map option. What if I disabled the express usage of memory mapping?
So I turned off my Input Codecs -> Access Modules -> MMap -> Use file memory mapping, and now my system uses
Active memory during playback not Inactive memory. The Active memory gets released upon quitting VLC as I figured
it should.

So I guess I don't have a problem per se. It might even be normal behavior.
THANK YOU! WHAT A RELEIF! :D
Even better, I just played a dvd and it didn't even chew away the free memory as it played.

The "memory map" function should come disabled and with a big warning when trying to turn it on. -It is now turned off and it will stay turned off!!!
That's exactly how I felt when I found out about the "memory map" option. And thank goodness I did!!! My system would literally be crawling when I was finished with a movie, now all is normal. THIS SHOULD BE DISABLED BY DEFAULT!!!

Re: huge memory leak

Posted: 27 Nov 2010 18:24
by RĂ©mi Denis-Courmont
The memory map option is disabled by default, and it has been that way in every VLC releases to include it. Except the MacOS developers decided to enable it on MacOS.

Re: huge memory leak

Posted: 14 Feb 2011 00:37
by stevenmusicmaker
Hey guys in VideoLAN,
I stumbled across this posting and think it may answer why I run out of free memory and quitting the suspect program does not change anything. I recently downloaded both VLC and jDownloader, since in a way they are complementary programs, that is, you need to have movies downloaded so you can watch them on VLC. I am a novice when it comes to really understanding computer speak, so things go over my head very easily! I thought the constant downloading (all night) was what was filling up my inactive memory (the blue color) and that was why my free memory (the light green color) was almost gone. While downloading, I was also watching (sort of) VLC movies and now I am realizing it was the VLC memory mapping that was set to ON, by de-fault, that was using up available Free memory, somehow. Because I was doing these extended downloads, I did not want to re-start my machine to somehow re-capture free memory. While I thought it was jDownloader eating up my memory, it was actually VLC, from what I read above.

I have a Macbook Pro running MacOSX 10.6.6, VLC 1.1.7. Just to re-cap, because of what was previously stated by VlcAwesome, I went to the overhead menu bar and clicked on VLC and opened Preferences. Then when they opened I clicked on Input & Codecs, found at the top of the Preference window. Next I went to the bottom left of Input & Codecs and clicked on All, instead of Basic, which opened another window. At the top left of this window was MMap, inside the scrolling window under MMap was Input/Codecs, I scrolled downed beneath Access modules and found MMap (again), which I clicked on, which gave me access near the top to allow me to Uncheck the box next to, Use file memory mapping.

Now, guys that know Mac compu-speak, have I corrected VLC so it will not eat up memory incorrectly? As soon as I finish writing this, I will turn my machine off and on, because though I did the above, quitting VLC did not release the blue inactive memory, which I think restart will. If I understand properly, by changing the settings as outlined, VLC will no longer eat inactive memory, and what memory it does use will be released when exiting the program.

Now look, I wrote this out in 'long-hand' for people, like myself, that would like someone to hold their hand as they go through the process to make sure they have done things properly. If I missed something, please tell me!

Thank you, glad for this forum and the people on it! The guys over head have really been a great help!

Re: huge memory leak

Posted: 17 Feb 2011 19:31
by ajmas
It is possible that this could was activated for performance reasons.

A quick search on the issue reveals this thread on Omnigroup's macosx-dev mailing-list, with the solution being outlined here: http://www.omnigroup.com/mailman/archiv ... 46790.html

If someone is in a position to modify the code to support this and see if it changes anything, then that would cool.