@rystills wrote:
I've recently been looking to reduce instances of dynamic memory allocation, and I noticed that my drawHUD function (which is called each frame) generates some memory with each call, which builds up over time and eventually must be garbage collected. Curious as to why, I decided to compare memory snapshots in visual studio, and I discovered that each instance of SpriteBatch.Draw is generating a small amount of memory. According to the snapshots, one call to SpriteBatch.Draw generates an additional 4 counts of "HandleCollector+HandleType", and an additional 1 count of "SharpDX.Direct3D11.ShaderResourceView". While I recognize that in isolation these calls are generating negligible amounts of memory, the type of game I'm working on requires a consistently smooth framerate, so I'd really like to avoid any unnecessary buildup of garbage. Is the memory generated during SpriteBatch calls unavoidable, and if so, are there any tips for minimizing memory usage in the rendering process as a whole?
Posts: 1
Participants: 1