[SlimDX] Sprite.End() causes memory leak

Started by
3 comments, last by Luco 13 years, 8 months ago
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.
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).

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

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
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.
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.

This topic is closed to new replies.

Advertisement