home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Fix possible memory leaks in DirectshowUtil
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="peterk2007" data-source="post: 197495" data-attributes="member: 49171"><p>Hi ronilse,</p><p></p><p>Sorry for the delay, I had no testing environment with TV card for a few days, and I did not want to respond without testing. <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> I have tested now, and it works for me. No DVD errrors and no TV playback errors at all.</p><p></p><p>Checking the log you have submitted, the crash is at a DirectShowLib.dll call, and there is nowhere near a call to Core\DShowNET\Helper\DirectShowUtil.cs - the one that should crash if my patch causes the problem. (Actually, the graph building before finishes successfully.) I did a modification to DirectShowLib.dll tho, but that was very simple: just added a tiny little function there - which is only called from my modified Core\DShowNET\Helper\DirectShowUtil.cs. So that shouldn't break DirectShowLib.dll down.</p><p></p><p>I could actually produce a similar (not the same, but similar) error by compiling the code, and only replacing the affected dll-s (core.dll and directshowlib.dll). But as soon as I did a full rebuild and made sure every binary had been replaced by the newly built binaries, there was no problem at all, everything worked fine. So here is where i'll be a pain in the neck <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" /> : Could you please re-test the patch making sure that all binaries are recompiled and replaced? Thank you indeed.</p><p></p><p>diehard2:</p><p>Well, GC "should" take care of releasing. The problem is when? <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> .</p><p></p><p>Since each RCW (COM object's .NET wrapper) is very tiny, in some scenarios thousands of RCW's could "sit" and wait for finalization for a very long time before the managed heap gets large enough to trigger a GC. This can be problematic, because while an RCW is tiny, the COM "behind" the RCW can hold onto large amounts of unmanaged memory (which is not part of the managed heap, so does not affects when GC gets triggered).</p><p></p><p>Since MP is often a long term running application, there are scenarios where dozens or even hundreds of initiated directshow playback could take place (leaving loaded filters languishing in memory for long period of time).</p><p></p><p>I guess the creators of DirectshowLib think it is better to stay on the safe side and prevent things before happening, because they explicitly mention to release COM objects in their readme.rtf. <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> (Section "Releasing memory to avoid leaks (Marshal.FreeCoTaskMem, FreeAMMediaType, FreePinInfo)")</p><p>cheers,</p><p>Peter</p><p></p><p>My test environment:</p><p><strong>MediaPortal Version</strong>: Daily SVN16350 (+ applied the patch with the latest SVN source 16369)</p><p><strong>MediaPortal Skin</strong>: BlueTwo</p><p><strong>Windows Version</strong>: XP Prof. SP2 w. updates</p><p><strong>CPU Type</strong>: AMD X2 4400+</p><p><strong>HDD</strong>: Samsung 200GB, 250GB, 320GB</p><p><strong>Memory</strong>: 1GB</p><p><strong>Motherboard</strong>: Asus M2N-VM DH</p><p><strong>Motherboard Chipset</strong>: NVidia</p><p><strong>Video Card</strong>: NVidia 7600GS</p><p><strong>Video Card Driver</strong>: Forceware 162.18</p><p><strong>Sound Card</strong>: Onboard AC97</p><p><strong>Sound Card AC3</strong>: Yes</p><p><strong>1. TV Card</strong>: HAUPPAUGE MC150</p><p><strong>1. TV Card Type</strong>: Analog</p><p><strong>1. TV Card Driver</strong>: Latest</p><p><strong>MPEG2 Video Codec</strong>: Cybelink PowerDVD7</p><p><strong>MPEG2 Audio Codec</strong>: ffdshow</p><p><strong>Remote</strong>: MCE</p><p><strong>TV</strong>: Samsung CRT, Toshiba Proj.</p><p><strong>TV - HTPC Connection</strong>: S-Video, DVI</p><p></p><p>Attached the log too.</p></blockquote><p></p>
[QUOTE="peterk2007, post: 197495, member: 49171"] Hi ronilse, Sorry for the delay, I had no testing environment with TV card for a few days, and I did not want to respond without testing. :) I have tested now, and it works for me. No DVD errrors and no TV playback errors at all. Checking the log you have submitted, the crash is at a DirectShowLib.dll call, and there is nowhere near a call to Core\DShowNET\Helper\DirectShowUtil.cs - the one that should crash if my patch causes the problem. (Actually, the graph building before finishes successfully.) I did a modification to DirectShowLib.dll tho, but that was very simple: just added a tiny little function there - which is only called from my modified Core\DShowNET\Helper\DirectShowUtil.cs. So that shouldn't break DirectShowLib.dll down. I could actually produce a similar (not the same, but similar) error by compiling the code, and only replacing the affected dll-s (core.dll and directshowlib.dll). But as soon as I did a full rebuild and made sure every binary had been replaced by the newly built binaries, there was no problem at all, everything worked fine. So here is where i'll be a pain in the neck ;) : Could you please re-test the patch making sure that all binaries are recompiled and replaced? Thank you indeed. diehard2: Well, GC "should" take care of releasing. The problem is when? :) . Since each RCW (COM object's .NET wrapper) is very tiny, in some scenarios thousands of RCW's could "sit" and wait for finalization for a very long time before the managed heap gets large enough to trigger a GC. This can be problematic, because while an RCW is tiny, the COM "behind" the RCW can hold onto large amounts of unmanaged memory (which is not part of the managed heap, so does not affects when GC gets triggered). Since MP is often a long term running application, there are scenarios where dozens or even hundreds of initiated directshow playback could take place (leaving loaded filters languishing in memory for long period of time). I guess the creators of DirectshowLib think it is better to stay on the safe side and prevent things before happening, because they explicitly mention to release COM objects in their readme.rtf. :) (Section "Releasing memory to avoid leaks (Marshal.FreeCoTaskMem, FreeAMMediaType, FreePinInfo)") cheers, Peter My test environment: [b]MediaPortal Version[/b]: Daily SVN16350 (+ applied the patch with the latest SVN source 16369) [b]MediaPortal Skin[/b]: BlueTwo [b]Windows Version[/b]: XP Prof. SP2 w. updates [b]CPU Type[/b]: AMD X2 4400+ [b]HDD[/b]: Samsung 200GB, 250GB, 320GB [b]Memory[/b]: 1GB [b]Motherboard[/b]: Asus M2N-VM DH [b]Motherboard Chipset[/b]: NVidia [b]Video Card[/b]: NVidia 7600GS [b]Video Card Driver[/b]: Forceware 162.18 [b]Sound Card[/b]: Onboard AC97 [b]Sound Card AC3[/b]: Yes [b]1. TV Card[/b]: HAUPPAUGE MC150 [b]1. TV Card Type[/b]: Analog [b]1. TV Card Driver[/b]: Latest [b]MPEG2 Video Codec[/b]: Cybelink PowerDVD7 [b]MPEG2 Audio Codec[/b]: ffdshow [b]Remote[/b]: MCE [b]TV[/b]: Samsung CRT, Toshiba Proj. [b]TV - HTPC Connection[/b]: S-Video, DVI Attached the log too. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Fix possible memory leaks in DirectshowUtil
Contact us
RSS
Top
Bottom