Jump to content
  • Advertisement
Sign in to follow this  
Luco

[SlimDX] Sprite.End() causes memory leak

This topic is 2852 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

So... for the past month or so I have been writing a tool that shows image sequences really really fast.

On one machine there is a memory leak, Ram usage goes through the roof and everything crashes. This happens only on this one machine. I've tried reinstalling the SlimDX Runtime, that did not help.

Windows XP SP3
SlimDX Runtime June 2010
.NET 3.5

The memory leak happens as i step between Sprite.End() and the closing bracket for my rendering function.


public void CustomRender()
{
Sprite.Begin(SpriteFlags.None);
foreach(Sequence_Item item in Sequences)
{
item.Draw(Sprite, Frame);
}
Sprite.End();
------------------------>Memory increase 1 mb or so every render right here
}


This is not a big deal for me at all but i would like to know what is happening. Might interest SlimDX developers too.

Share this post


Link to post
Share on other sites
Advertisement
Other than doing something in your item.Draw code, there are no allocations there from the SlimDX framework that we control (i.e. none that we perform).

Share this post


Link to post
Share on other sites
That is why it's interesting. Same executable runs just fine on 3 other machines. What I do is load a lot of textures into managed pool and draw them, its very simple. I go through my drawing code with no memory problem but as soon as i step over Sprite.End() I can see a significant increase of ram used in my task manager. Might be faulty hardware or drivers.

DirectX 9.0c
NVIDIA Quadro FX 1300
Intel Xeon CPU 2.8GHZ 4CPUs

Share this post


Link to post
Share on other sites
Quote:
Original post by Luco
That is why it's interesting. Same executable runs just fine on 3 other machines. What I do is load a lot of textures into managed pool and draw them, its very simple. I go through my drawing code with no memory problem but as soon as i step over Sprite.End() I can see a significant increase of ram used in my task manager. Might be faulty hardware or drivers.

DirectX 9.0c
NVIDIA Quadro FX 1300
Intel Xeon CPU 2.8GHZ 4CPUs
Does it continue to increase? How much does it increase? The amount shown in task manager is the programs working set, which is not the same as it's used memory. Just because that increases, doesn't mean that your app has a memory leak.

Share this post


Link to post
Share on other sites
It continues to increase with every render cycle. It increases for 2GB (WindowsXP allocated memory per process) and then crashes, the PC does not respond. If I stop it when it increased say 1GB and quit my program the 1GB memory stays in use and does not belong to any process. In my program I have a Ram Manager, it shows the memory used by this process since I load tons of images into memory and need to know when to stop. The Ram Manager does not show the 1GB belonging to the process of my program. Say I load 50 images, Ram Manager says I still have 1.5 gigs left. As soon as i start simulating and going through the Sprite.End() in task manager memory grows, but Ram Manager does not since it does not belong to the process my software is running in.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!