jamaal81 / lavfilters

Automatically exported from code.google.com/p/lavfilters
GNU General Public License v2.0
0 stars 0 forks source link

Memory leak / windows app crash after opening multiple time LAV video or splitter #450

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Describe the issue you're having:

I'm developing an application where you can setup a playlist of video. The 
application opens and plays each video one after the other in a loop until 
someone closes it.

I'm using LAV filters with DirectShow in order to read the videos and I have to 
say it works wonderful.

However, if the app runs for several hours, it suddently crash due to the max 
number of Handles allocated by windows for a single app.

I've done multiple tests to ensure the problem comes from LAV and not from my 
app.

How can the issue be reproduced? Sample File?

You can easily reproduce the problem using Media Player Classic (or any other 
player that uses LAV I guess).

Open media player classic, load the video attached (or any other) with a drag 
and drop, wait for the video to complete play (around 2 seconds), re-open the 
video, re-wait for play to finish, .... redo around 20-30 times. You'll see 
that the handles already increase (task manager with handle column displayed). 
Please note that I was able to reproduce the same on windows 7 and windows 8.1

Attached to the issue, you'll find two pictures presenting the handles used by 
Media Player Classic and my own app after loading 35 times the same video or 
running for a defined duration. You'll see that LAV 0.58 have no issue. LAV 
0.58.1 has the issue!

What version of the product are you using? In which Player?

I've tested many other versions of LAV including the latest and 0.58.2, 0.57, 
0.61, ... I can confirm version 0.58 and previous are OK, all versions after 
have the issue.

Please provide any additional information below.

I'd be really glad if you could fix that one. I think not much changes occured 
between 0.58 and 0.58.1 so it could be easy to spot?

Thank you in advance.
Cheers
Gaël

Original issue reported on code.google.com by gael.dec...@gmail.com on 8 May 2014 at 8:03

Attachments:

GoogleCodeExporter commented 9 years ago
I tested in MPC-HC, and I'm not convinced its LAVs fault.
When I constantly re-play your file with MPC-HC using no LAV filters at all, it 
still increases its handles by the same amount every time.

Original comment by h.lepp...@gmail.com on 8 May 2014 at 8:31

GoogleCodeExporter commented 9 years ago
Looks like something on my system causes the handles to inflate much higher no 
matter what LAV does, I get around 5000 handles after 5 times re-opening the 
video already, which of course hides a possibly tiny handle leak somewhere else.

Original comment by h.lepp...@gmail.com on 8 May 2014 at 9:17

GoogleCodeExporter commented 9 years ago
I think it might be related to other libraries that LAV uses (FFMPEG?) which 
would explain why without LAV it continues to increase?

The thing I'm sure about is that if you uninstall LAV filters and reinstall 
version 0.58 or 0.57 using the exe file provided, the problem disapear. As soon 
as I re-install a version equals or higher than 0.58.1, then the problem comes 
back.

Original comment by gael.dec...@gmail.com on 8 May 2014 at 9:35

GoogleCodeExporter commented 9 years ago
I figured out what caused the problem, however I'm unsure how to fix it.
I'll have to think about this some more.

Original comment by h.lepp...@gmail.com on 8 May 2014 at 1:41

GoogleCodeExporter commented 9 years ago
Sounds like good news :)
Let me know if you want me to test some release if you find any way to fix it.

Original comment by gael.dec...@gmail.com on 8 May 2014 at 1:44

GoogleCodeExporter commented 9 years ago
Here is a build which should hopefully solve the problem:
32-bit: http://files.1f0.de/lavf/LAVFilters-0.61.2-15-gd62e83d.zip
64-bit: http://files.1f0.de/lavf/LAVFilters-0.61.2-15-gd62e83d-x64.zip

Let me know if it does.

Original comment by h.lepp...@gmail.com on 12 May 2014 at 6:53

GoogleCodeExporter commented 9 years ago
I've done some tests today and I think the handle problem is solved. However 
I've found that the amount of memory used by the app increase slightly over 
time when loading and unloading videos many many times.

I cannot confirm it has anything to do with the video codec nor the app. Will 
run a few more tests tomorrow and let you know.

In any case, thank you very much for the changes as it definitely fixed 
something.

Original comment by gael.dec...@gmail.com on 12 May 2014 at 3:22

GoogleCodeExporter commented 9 years ago
Hi,

Sorry for the delay. I've done loads of tests including 0.58 and the new 
version you made available to me. Computers have been running several days 
playing one video each 2 seconds without any problem.

The new version seems to be more stable and use less ressources than 0.58. So 
for me it looks like you fixed everything listed above.

Thank you again! Much appreciated!

Quick question: will this fix be included within the next release?

Best Regards
Gaël

Original comment by gael.dec...@gmail.com on 22 May 2014 at 8:01

GoogleCodeExporter commented 9 years ago
Great!

Yes, this will be in the next release.

Original comment by h.lepp...@gmail.com on 22 May 2014 at 8:23