| |||||||
| General Development (no feature request here!) You were able to fix an issue, or improved a feature? Post it here. |
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Portal Developer Join Date: Aug 2005 Location: Copenhagen Age: 29
Posts: 709
Thanks: 0
Thanked 9 Times in 6 Posts
Country: | Hi, Being annoyed with the problems with the Compress plug-in i decided to try to fix it. The problem is that whenever a transcoding job is in progress, the call GC.GetTotalMemory(true) doesnt return(at least within any reasonable time) when called in GUIWindow OnMessage when it gets a GUI_MSG_WINDOW_DEINIT message. This causes the effect that if you try to navigate away from the current window while the job is in progress, the gui blocks/locks. What i would like to know is a bit more about what the GC calls does. According to the documentation for GC.GetTotalMemory: Code: //
// Summary:
// Retrieves the number of bytes currently thought to be allocated. A parameter
// indicates whether this method can wait a short interval before returning,
// to allow the system to collect garbage and finalize objects.
//
// Parameters:
// forceFullCollection:
// A Boolean value which, if true, indicates that this method can wait for garbage
// collection to occur before returning.
//
// Returns:
// A number that is the best available approximation of the number of bytes
// currently allocated in managed memory.
I fixed the problem in my local installation by changing the call to GC.GetTotalMemory(false). Could the explanation be that the call waits for GC to finish, but GC might run with a very low priority so that it wont run because the transcoding job is eating up all the CPU time, locking the GUI which is waiting for it? I would also like to know why there are 3 call to GC.collect in a row preceding the call to GC.GetTotalMemory, why doesnt one suffice? |
| | |
| |
| | #2 (permalink) |
| Retired Team Member Join Date: Dec 2005
Posts: 77
Thanks: 0
Thanked 2 Times in 1 Post
| Generally speeking, it sounds like a resource contention issue. The transcoding is running in a seperate thread locking and unlocking resources and probably allocating/deallocating (indirectly) a lot of memory. One call to GC.Collect() should suffice for freeing all unreferenced memory. I don't know why three calls would be neccessary. The GC.GetTotalMemory call will need to temporarily lock any managed memory resources in order to obtain a snapshot of their size. My guess is that the transcoding thread is accessing a sufficient number of memory resources that it is gaining far more access to them than the GetTotalMemory call can, thus slowing down the call to GetTotalMemory. Just my 2 cents, Drak |
| | |
| | #3 (permalink) | |
| Portal Developer Join Date: Aug 2005 Location: Copenhagen Age: 29
Posts: 709
Thanks: 0
Thanked 9 Times in 6 Posts
Country: | Quote:
Im new to messing around with the MP code, should i just submit a patch for the GUIWindow.cs file at sourceforge? | |
| | |
| | #5 (permalink) | |
| Portal Developer Join Date: Aug 2005 Location: Copenhagen Age: 29
Posts: 709
Thanks: 0
Thanked 9 Times in 6 Posts
Country: | Quote:
| |
| | |
| | #6 (permalink) | |
| Retired Team Member | Quote:
![]() Good description, but there are no files attached to your patches on sf. I am no programmer, so I can“t say much to the patches themselves. tomtom | |
| | |
| | #7 (permalink) | |
| Portal Developer Join Date: Aug 2005 Location: Copenhagen Age: 29
Posts: 709
Thanks: 0
Thanked 9 Times in 6 Posts
Country: | Quote:
However i see that they are now listed as closed, and looking in the CVS both patches seem to have been applied( the memory usage is now not printed at all, GC.collect is not called at all, and the skin button is correctly specified). I guess someone(most likely yamp, based on who closed it) read the description and made the changes based on that.I didnt forget the files, however, i didnt notice the checkbox you had to check of to actually get it to upload the file ![]() | |
| | |
| | #8 (permalink) |
| Retired Team Member Join Date: Sep 2004 Location: Finland
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
| Hi, Thanks for your intrest of mediaportal. If you create other fixes i have found these tips useful when submitting code to the project. 1. Submit whole files not just diffs. 2. Open topic on forums with header [patch] short explanation 3. And if possibe try to contact devs on irc (been silent lately tho) 4. When submitting file describe your patch as much as possible. Hope these hints help you to submit your next patch. CoolHammer
__________________ AMD Sempron 2400+ / ATI AIW 9000 Pro / Samsung 120Gb / Asus A7N8X-VM/400 / Windows XP pro Fi /LG 32LP1 LCD TV connected with DVI /Sony amp connected with S/PDIF |
| | |
| | #9 (permalink) | |
| Portal Developer Join Date: Aug 2005 Location: Copenhagen Age: 29
Posts: 709
Thanks: 0
Thanked 9 Times in 6 Posts
Country: | Quote:
, i wasnt aware of the IRC developer chat nor the [patch] thread concept. Thanks for the information, i will heed you advice the next time i need to submit to submit a patch. | |
| | |
![]() |
| Bookmarks |
| Tags |
| collection, garbage, question |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question about hardware support of a Sabrent SBT-TVFM | M4GIC | General Support | 3 | 2008-05-26 07:39 |
| last.fm plugin: use last.fm tags for local music collection | tomtom21000 | Improvement Suggestions | 1 | 2006-11-13 23:00 |
| .wav File Music Collection | randomblondeboy | General Support | 0 | 2006-04-17 05:52 |
| Music scan misses 'Numerical' and/or 'Collection' Albums etc. | Funky | 0.2.0.0 Release Candidate 1 | 1 | 2005-11-27 21:52 |
| Question about the hauppauge 350 tv-out software? | Th3Eagle | OffTopic | 4 | 2005-08-02 22:19 |