1

I'm running multiple games in OpenTK within 1 application.

I'm creating new OpenTK instances for each game, but when you exit it will exit the game and then return to a menu, and dispose of the game instance.

The problem I'm facing is that memory is still accumulated from the previous game that I had exited, and I feel this is due to the textures and everything still loaded into the RAM.

How do I clear this out? Thanks!

Wezley
  • 413
  • 1
  • 3
  • 19
  • GL.DeleteTexture(int texID), but without your code, difficult to say more – j-p Jan 15 '15 at 13:08
  • How do I get the currently loaded texture ID's? – Wezley Jan 15 '15 at 14:50
  • Also running through a loop and deleting every texture doesn't doesn't stop the memory accumulation. – Wezley Jan 15 '15 at 14:59
  • Make sure you `Dispose()` all resources when you no longer need them. For instance, `GameWindow.Dispose()` and/or `GraphicsContext.Dispose()` (depending on how you are using OpenTK). – The Fiddler Jan 16 '15 at 13:13
  • Keep in mind that the C# gc is not running immediately, sometimes he decides it's ok for your application to stay at it's current memory level for about half a minute. – Vengarioth Feb 05 '15 at 15:42

0 Answers0