Menu

#15 Memory leaks from Clootils

closed-accepted
nobody
None
5
2012-12-19
2012-07-18
No

I compiled v0.9.1 in Visual Studio 2010 and ran Clootils. As the examples run memory leaks are reported on the visual studio output console. This is what it says when I run all the examples:
<code>
'Clootils.exe' (Managed (v2.0.50727)): Loaded 'E:\My Documents\My Projects\Cloo\Clootils\bin\Debug\Cloo.dll', Symbols loaded.
Information: Create ComputeContext(480971760) in Thread(1).
Information: Create ComputeCommandQueue(493509280) in Thread(1).
Information: Create ComputeBuffer`1(480651648) in Thread(1).
Information: Create ComputeProgram(493617904) in Thread(1).
Information: Create ComputeProgram(493618544) in Thread(1).
Warning: ComputeCommandQueue(493509280) leaked!
Information: Dispose ComputeCommandQueue(493509280) in Thread(2).
Warning: ComputeBuffer`1(480651648) leaked!
Information: Dispose ComputeBuffer`1(480651648) in Thread(2).
Information: Create ComputeKernel(481066400) in Thread(1).
Information: Create ComputeKernel(481066736) in Thread(1).
Information: Create ComputeKernel(481067296) in Thread(1).
Information: Create ComputeBuffer`1(480651648) in Thread(1).
Information: Create ComputeBuffer`1(480651280) in Thread(1).
Information: Create ComputeBuffer`1(480650912) in Thread(1).
Information: Create ComputeProgram(493618864) in Thread(1).
Information: Create ComputeKernel(481067520) in Thread(1).
Information: Create ComputeCommandQueue(481464832) in Thread(1).
Information: Create ComputeEvent(493445680) in Thread(1).
Information: Create ComputeEvent(481103008) in Thread(1).
Information: Complete NDRangeKernel operation of ComputeEvent(493445680).
Information: Complete ReadBuffer operation of ComputeEvent(481103008).
Information: Create ComputeCommandQueue(481465168) in Thread(1).
Information: Create ComputeBuffer`1(480654224) in Thread(1).
Warning: ComputeProgram(493618544) leaked!
Information: Dispose ComputeProgram(493618544) in Thread(2).
Warning: ComputeEvent(481103008) leaked!
Information: Dispose ComputeEvent(481103008) in Thread(2).
Information: Create ComputeEvent(481102592) in Thread(1).
Information: Create ComputeEvent(481103008) in Thread(1).
Warning: ComputeKernel(481066736) leaked!
Information: Dispose ComputeKernel(481066736) in Thread(2).
Information: Complete WriteBuffer operation of ComputeEvent(481102592).
Warning: ComputeKernel(481066400) leaked!
Information: Dispose ComputeKernel(481066400) in Thread(2).
Warning: ComputeEvent(493445680) leaked!
Information: Dispose ComputeEvent(493445680) in Thread(2).
Warning: ComputeCommandQueue(481464832) leaked!
Information: Dispose ComputeEvent(481102592) in Thread(4).
Information: Dispose ComputeCommandQueue(481464832) in Thread(2).
Information: Complete ReadBuffer operation of ComputeEvent(481103008).
Information: Dispose ComputeEvent(481103008) in Thread(4).
Information: Create ComputeEvent(481103008) in Thread(1).
Information: Create ComputeEvent(481102592) in Thread(1).
Information: Complete WriteBufferRectangle operation of ComputeEvent(481103008).
Information: Dispose ComputeEvent(481103008) in Thread(4).
Information: Complete ReadBufferRectangle operation of ComputeEvent(481102592).
Information: Dispose ComputeEvent(481102592) in Thread(4).
Information: Create ComputeEvent(481102592) in Thread(1).
Information: Create ComputeEvent(481103008) in Thread(1).
Information: Complete WriteBufferRectangle operation of ComputeEvent(481102592).
Information: Dispose ComputeEvent(481102592) in Thread(4).
Information: Complete ReadBufferRectangle operation of ComputeEvent(481103008).
Information: Dispose ComputeEvent(481103008) in Thread(4).
Warning: ComputeKernel(481067296) leaked!
Information: Dispose ComputeKernel(481067296) in Thread(2).
Warning: ComputeKernel(481067520) leaked!
Information: Dispose ComputeKernel(481067520) in Thread(2).
Warning: ComputeBuffer`1(480650912) leaked!
Information: Dispose ComputeBuffer`1(480650912) in Thread(2).
Warning: ComputeBuffer`1(480651280) leaked!
Information: Dispose ComputeBuffer`1(480651280) in Thread(2).
Warning: ComputeBuffer`1(480651648) leaked!
Information: Dispose ComputeBuffer`1(480651648) in Thread(2).
The thread '<No Name>' (0x1968) has exited with code 0 (0x0).
</code>

Discussion

  • Anonymous

    Anonymous - 2012-07-18

    Patch for removing memory leaks in clootils

     
  • Anonymous

    Anonymous - 2012-07-18

    It seems that if I dispose of the objects being created in the examples then the memory leaks go away. What I'm not sure about is if it is ok to just start Dispose()'ing stuff. I'm a newb with Cloo and OpenCL.

    Please have a look and incorporate if it is ok to do so.

     
  • nythrix

    nythrix - 2012-12-19

    They're not really memory leaks (it's a "Warning" not an "Error"). The garbage collector will dispose of these objects. It is advisable, however, to do this manually in case you get some strange exceptions (check this post: http://www.opentk.com/node/2244#comment-11273\)

     
  • nythrix

    nythrix - 2012-12-19
    • status: open --> closed
     
  • nythrix

    nythrix - 2012-12-19
    • status: closed --> closed-accepted
     

Log in to post a comment.