Jump to content
  • Advertisement
Sign in to follow this  
Winegums

[.net] Memory leaks with 3d files in WPF

This topic is 4152 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

the WPF app i'm currently writing features a xaml file with a 3d object. this file is called often during the programs running to display a transition screen between one page and another. however frequent calls to this page seem to result in a gradually increasing memory leak. Since I'm not explicitly deleting anything, I understand how this could be the case. Is there some way to unload the page from memory during execution?

Share this post


Link to post
Share on other sites
Advertisement
Your description is too vague give a specific answer, so I'll give a generic one.

Make sure that references to any extra, unnecessary objects (such as are used to create this xaml file?) are set to null. And make sure you call Dispose on any IDisposable objects.

For example, and this is totally hypothetical, suppose you're creating the xaml file in a buffer in memory each frame, and not setting it to null. Those won't be cleaned up, as the garbage collector will see that references to them still exist in active code.

Another example: if you're using managed directx or xna (and again, the vagueness of your post makes this impossible to know), call Dispose on any objects you temporarily create while creating the xaml file.

Share this post


Link to post
Share on other sites
Hi, thanks for your reply. sorry about the vagueness, I wasn't sure what you needed to know. i'm using c# for the backing for these files.

The model data is held within the .xaml file used for transition screens.

The page isn't unloaded at any point, but rather a new instance is added to the display surface each time the page is changed. None of the material I've looked at has covered deleting old pages from memory.

EDIT: managed to sort it. iterate through teh scene, grab the UI elements, remove them.


[Edited by - Winegums on June 12, 2007 9:38:44 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!