AnsweredAssumed Answered

Possible memory leak

Question asked by levyfan on Sep 17, 2012
Latest reply on Mar 10, 2013 by bahamut

We encounter memory leak problems and the app profiler can't help. (we simply use windows resource monitor.)

A test code sample is given and the code structure is simple:

 

cl_kernel memset;

cl_command_queue Q1, Q2;

for(;;) {

     cl_event Q1_evt[51];

     cl_event Q2_evt[50];

     clEnqueueNDRangeKernel(Q1, memset, ..., 0, NULL, &Q1_evt[0]);

     for (int iter = 0; iter < 50; iter++) {

         clEnqueueNDRangeKernel(Q2, memset, ..., 1, &Q1_evt[iter], &Q2_evt[iter]);

         clEnqueueNDRangeKernel(Q1, memset, ..., 1, &Q2_evt[iter], &Q1_evt[iter+1]);

     }

     for (int i=0; i<50; i++) {

         clReleaseEvent(Q1_evt[i]);

         clReleaseEvent(Q2_evt[i]);

     }

     clReleaseEvent(Q1_evt[50]);

     clFinish(Q1);

     clFinish(Q2);

}

 

it is a twisted waiting structure that Q1 waits for Q2 and vise versa.

i guess clReleaseEvent() may not function right, so i create a thread here: http://devgurus.amd.com/message/1283971

 

my environment:

HD 7970, APP SDK 2.7, Catalyst 12.6 Beta (8.98-120522a-139735E-ATI), win7 64bit

Attachments

Outcomes