2009-12-16, 03:27 AM
Great, glad you got it all sorted out.
2009-12-16, 03:27 AM
Great, glad you got it all sorted out.
I'm back!
I need to return to the subject of disposing popup resources, because I must be doing something wrong. I've been attaching perfmon to PVRX2 to see how things in memory are behaving. Managed memory seems pretty stable, but private bytes are just doing silly things. Both private and virtual bytes are increasing (the amount of which they increase varies with the complexity of the popup, the more complex the popup, the more the memory is consumed). In turn, they never recover, with each new popup taking a fresh chunk of memory. I originally just wrote this off as .NET not bothering to give memory back until some other process asked, but over time, system performance deteriorates. You can hear it paging as the main menu scrolls. Eventually, it reaches the point where it can no longer create new resources at all. Popups come out blank, even the main menu will no longer display. PVRX2 must then be shut down via alt-F4. At this point, private bytes are over 1GB. (Which, on a machine that only has 1GB of ram in the first place, is a fair chunk of memory for one process.) Sure, a newer machine with 4GB would do better, but I think it would just postpone the inevitable. Popup code is pretty much as you listed. The popup itself is a base class (implements IUiTask, Inherits Popups.PopupBase) which holds WizControlManager, a couple of strings (popup name, skinsubdirectory) and has needsRendering. The popup proper inherits from this, and implements IUiPopup. Do I need to be implementing my own Dispose() after all? (Going to do some experimenting with this now.) Or... doing something... else? Any guesses / suggestions? Edit: Followup. A .dispose on ControlManager did wonders, although a less aggressive increase in private bytes remains. Tomorrow's task is to create a popup with no controls whatsoever, and see what happens with that. Suggestions remain welcome!
2010-02-11, 04:57 AM
My popup forms implement PopupBase and IUiPopup as follows:
Code: [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]class[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]MovieInfoPopup[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] : [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]PopupBase[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]IUiPopup[/COLOR][/SIZE] Code: public override void Dispose() [SIZE=2]In the main program I treat this like any other popup: [/SIZE][/SIZE] Code: setPopup(new MovieInfoPopup(this, core, me, false, mSkinDirectory)); and like any other popup, when done: setPopup(null); Code: [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] setPopup([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]IMenuTask[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] popup)[/SIZE]
2010-02-11, 08:09 AM
Thanks for the reply. That's pretty much what I have now, which is both encouraging and discouraging at the same time.
Over the last hour, I've done some more playing. First, I created a blank popup. No WizUiTools controls, or, for that matter, any other controls. Just a blank. No disposable resources. Code: #If DEBUG Then Result: private bytes continue to grow. Not as sharply as before, but steady growth regardless. (Exception: it will drop somewhat when the GC runs, but the overall trend is upward.) Next test, leaving the plugin world. Using the "Settings|Skin" popup as a test, I went through the same motions. Result this time, private bytes continued to rise, quite quickly actually. In all cases, managed memory is steady. If I'm understanding things correctly, then, it is unmanaged resources that are wandering off. Tonight's adventures leave me suspecting that I've moved outside the realm of the WizUi toolset, and that it might be time to poke at sub instead. (While happily acknowledging that I might be making errors in interpretation. This is a new area for me.)
2010-03-17, 01:16 PM
JavaWiz: Can the WizInfo log features be used from outside a GB-PVR process?
My Projects
Programs Plugin [SIZE=2](retired) | Volume OSD Plugin (retired) | Documentation Wiki (retired)[/SIZE]
2010-03-18, 12:46 AM
McBainUK Wrote:JavaWiz: Can the WizInfo log features be used from outside a GB-PVR process?Not exactly. Use the WLog functions in WizGenHelper instead, less dependencies on all the other DLLs...
2010-03-18, 08:22 AM
JavaWiz:
Using the latest developer zip from the wiki (although I note it has an earlier date than the compiled DLLs), I'm getting an Index Out of Range exception when trying to do a setListItem(Index, Item) on the last item of a list. (Yes, I'm quite confident that the index is correct!) I also understand that you're not exclusively maintaining the controls anymore. Is this something that I should be looking into fixing myself?
2010-03-27, 06:11 PM
Actually, I (think) I still have the most current version of the code. Could you paste a snippet of the code that causes the problem, I'll take a look. I'm on the road right now, will not be able to troubleshoot for a couple weeks...
2010-03-27, 09:55 PM
Ok! Snippet incoming!
Short version -- Code: WizUiList.setListItem(WizUiList.count() - 1, new WizListItem() ); I'm adding a 'seen' icon to a list item with the associated file is, er, seen. So some actual code, extra bits removed. Get the currently selected item and it's index. Make a change to said item. Place it back into list using the index from earlier. Which works great, except for the very last item in the list, which gives an "Index out of Range". Code: WizUiList.WizListItem lstItem = (WizUiList.WizListItem) lstFiles.getCurrentItem(); As I poke at it now, I can probably work around the problem by using getSelectedItem() repeatedly, instead of creating a local reference. But since I do a fair amount of fussing with the list item, it's sharply more convenient not to have to do all that casting about. Hope your trip is going well - thank you for taking a look at it when you're able! |
|