Skip to main content
Added an image to clarify behaviour.
Source Link

one Thing I found out: Windows 7 produces a memory leak while using certain methods to access rendertargets. Why doesn't Windows 8 leak at this method?

public class Game : SharpDX.Toolkit.Game { GraphicsDeviceManager gdm; RenderTarget2D target; public Game() { gdm = new GraphicsDeviceManager(this); } protected override void LoadContent() { target = RenderTarget2D.New(GraphicsDevice, 1000, 1000, PixelFormat.R8G8B8A8.UNorm); base.LoadContent(); } private Color GetColor(int x, int y) { using (Image image = target.GetDataAsImage()) { PixelBuffer buffer = image.PixelBuffer[0]; Color color = buffer.GetPixel<Color>(x, y); buffer = null; return color; } } protected override void Update(GameTime gameTime) { GetColor(5, 5); base.Update(gameTime); } } 

The memory consumption with this on Windows 8 is around 25 MB, Windows 7 uses up full memory. Any idea why Windows 8 handles memory/graphics in another way than Windows 7 (and how to fix it)?
For clarification if it was a memory leak: Memoryleak
The drop is caused by closing the application.

one Thing I found out: Windows 7 produces a memory leak while using certain methods to access rendertargets. Why doesn't Windows 8 leak at this method?

public class Game : SharpDX.Toolkit.Game { GraphicsDeviceManager gdm; RenderTarget2D target; public Game() { gdm = new GraphicsDeviceManager(this); } protected override void LoadContent() { target = RenderTarget2D.New(GraphicsDevice, 1000, 1000, PixelFormat.R8G8B8A8.UNorm); base.LoadContent(); } private Color GetColor(int x, int y) { using (Image image = target.GetDataAsImage()) { PixelBuffer buffer = image.PixelBuffer[0]; Color color = buffer.GetPixel<Color>(x, y); buffer = null; return color; } } protected override void Update(GameTime gameTime) { GetColor(5, 5); base.Update(gameTime); } } 

The memory consumption with this on Windows 8 is around 25 MB, Windows 7 uses up full memory. Any idea why Windows 8 handles memory/graphics in another way than Windows 7 (and how to fix it)?

one Thing I found out: Windows 7 produces a memory leak while using certain methods to access rendertargets. Why doesn't Windows 8 leak at this method?

public class Game : SharpDX.Toolkit.Game { GraphicsDeviceManager gdm; RenderTarget2D target; public Game() { gdm = new GraphicsDeviceManager(this); } protected override void LoadContent() { target = RenderTarget2D.New(GraphicsDevice, 1000, 1000, PixelFormat.R8G8B8A8.UNorm); base.LoadContent(); } private Color GetColor(int x, int y) { using (Image image = target.GetDataAsImage()) { PixelBuffer buffer = image.PixelBuffer[0]; Color color = buffer.GetPixel<Color>(x, y); buffer = null; return color; } } protected override void Update(GameTime gameTime) { GetColor(5, 5); base.Update(gameTime); } } 

The memory consumption with this on Windows 8 is around 25 MB, Windows 7 uses up full memory. Any idea why Windows 8 handles memory/graphics in another way than Windows 7 (and how to fix it)?
For clarification if it was a memory leak: Memoryleak
The drop is caused by closing the application.

Tweeted twitter.com/#!/StackGameDev/status/386870931693793280
Source Link

Memory Leak in SharpDX

one Thing I found out: Windows 7 produces a memory leak while using certain methods to access rendertargets. Why doesn't Windows 8 leak at this method?

public class Game : SharpDX.Toolkit.Game { GraphicsDeviceManager gdm; RenderTarget2D target; public Game() { gdm = new GraphicsDeviceManager(this); } protected override void LoadContent() { target = RenderTarget2D.New(GraphicsDevice, 1000, 1000, PixelFormat.R8G8B8A8.UNorm); base.LoadContent(); } private Color GetColor(int x, int y) { using (Image image = target.GetDataAsImage()) { PixelBuffer buffer = image.PixelBuffer[0]; Color color = buffer.GetPixel<Color>(x, y); buffer = null; return color; } } protected override void Update(GameTime gameTime) { GetColor(5, 5); base.Update(gameTime); } } 

The memory consumption with this on Windows 8 is around 25 MB, Windows 7 uses up full memory. Any idea why Windows 8 handles memory/graphics in another way than Windows 7 (and how to fix it)?