Bitmap.Save, Huge Memory Leak

前端 未结 5 1164
情歌与酒
情歌与酒 2021-01-16 05:02

I have an application where I am taking a bitmap and compressing it using a GZipStream and sending it over a socket, all in memory. I have tracked down the dirty scumbag mem

5条回答
  •  独厮守ぢ
    2021-01-16 05:36

    Are you calling the .Dispose() method of your Graphics object? That will cause a memory leak. EDIT: Once you have written the byte[], you are now clear to .Dispose() of the Bitmap object.

提交回复
热议问题