XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Leak within GraphicsDevice during content loads/unloads?

Last post 09-22-2008 6:58 PM by Bo Jordan. 2 replies.
  • 09-22-2008 6:34 PM

    Leak within GraphicsDevice during content loads/unloads?

    My current project is required to load and unload significant amounts of content, and I am seeing a significant performance issue once enough loads and unloads have occurred. Specifically, inside GraphicsDevice there is an internal Microsoft.Xna.Framework.Graphics.DeviceResourceManager class, which contains a dictionary of ResourceData structs with weak references to the content. Every time there is a content load, a reference to each asset is added to this collection. However, this dictionary doesn't appear to ever be flushed, even when the referenced content has been disposed. In my tests my app performance is killed within a few hours as this collection grows aggressively.

    Is there a proper way to flush this collection? Resetting the GraphicsDevice doesn't appear to be enough. I'm currently reflecting into the collection to clean things up, and it appears to be stable in initial testing. Is there a better method?

    From what I can tell XNA 3.0 beta will have the same issue. I will open a bug in Connect with my work-around code and post a link.

    Thanks for any help!

    Bo Jordan
  • 09-22-2008 6:46 PM In reply to

    Re: Leak within GraphicsDevice during content loads/unloads?

    I believe this issue is already fixed in 3.0 (although not in the beta).
    XNA Framework Developer - blog - homepage
  • 09-22-2008 6:58 PM In reply to

    Re: Leak within GraphicsDevice during content loads/unloads?

    Thanks! Just in case, I've opened an issue in Connect with my work-around. Does it appear sound?
Page 1 of 1 (3 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG