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)?