OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1663 Discussions

Memory leaks in clBuildProgram

Takaaki_H_
Beginner
195 Views
Hello, Memory usage of attached program continue to increase. It doesn't happen if a line that contains clBuildProgram call is removed. I'm using Ubuntu 12.04.1, Intel SDK for OpenCL Applications 2013 (3.0.67279) and g++ 4.6.3.
0 Kudos
5 Replies
Raghupathi_M_Intel
195 Views

Is there a reason why you are creating and releasing the program objects so many times? Though you are releasing the program everytime there may be some internal state/objects that the runtime maintains that doesnt get released right away. Maybe that's causing the "leak". I'll investigate more but would like to hear why you are doing what you are doing.

Thanks,
Raghu

 

Raghupathi_M_Intel
195 Views

I am submitting a bug. Even though what you are doing is not a best practice, nevertheless, you are releasing the program object and this shouldn't result in any memory leaks. Thanks for attaching the test case.

Raghu

Takaaki_H_
Beginner
195 Views

I know that building kernel many times is not a best practice. I found this problem when I was testing my application. This test needs building CL kernel with various parameter combinations.
I hope this bug to be fixed.

Thanks,
Takaaki

Andy_R
Beginner
195 Views

We're also having problems with the Intel OpenCL memory leak in clBuildProgram.

We're using version Intel OpenCL CPU Runtime version 3.0.0.63463 on Windows 7 and finding that every cycle of clCreateProgram->clBuildProgram->clReleaseProgram leaks significant memory (exactly in the same way that the intel-cl-leak.cpp file attached at the start of this thread demonstrates). This does not occur when the call to clBuildProgram is removed.

Has anyone found a solution to this or is a fix likely to be released?

This is highly problematic to us as we generate our OpenCL program source on the fly before each kernel execution and this can happen to the order of 1,000s of times within a single process space, which means we hit 'out of memory' errors as a result of this bug.

Thanks,

Andy

Raghupathi_M_Intel
195 Views

Hi Andy,

I don't have a date yet on the release with the fix. But will keep you posted. I will also escalate the issue.

Thanks,
Raghu

 

Reply