Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

How can I detect managed memory leak in a c# code? It's about a windowsform application using openGL for rendering 3D objects. Each time I redraw a memory leak is happening.

Base on the analysis done with DebugDiag tool , "C:\Windows\System32\ig75icd32.dll" is the source of memory leak.
Is this a bug in openGL or my code? How can I fix this issue?

I found the memory leek source. It was because of opneGL lists.
In a part of my code, I had this code for each 3D object

 void UpdateList(){
   _List = Gl.glGenLists(1);
   Gl.glNewList(_List, Gl.GL_COMPILE);
   Polygons.Draw();
   Gl.glEndList();

Which was in a loop (object's list updating in loop). So many lists were generated for each 3D object and there was many alive objects. I changed the code like this

void UpdateList(){
   if(_List==-1)
       _List = Gl.glGenLists(1);
   Gl.glNewList(_List, Gl.GL_COMPILE);
   Polygons.Draw();
   Gl.glEndList();

So only one list handel is generated for each 3D object.

have a look at snede.net/hunting-net-memory-leaks-with-windbg showing how to use WinDbg to find all of the issues – Walter Verhoeven Aug 25, 2019 at 10:46

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.