New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak problem #785
Comments
Could it be that this is #746 which got fixed a few days ago? |
Hi. I'm on develop branch and I've checked it's most recent. The problem does not apper when just running my console application. Maybe windows would automatically collect memory leaks and garbages so there's no error in console. |
Hi. I add this line in the destructor of my Class and my software stops crashing after exiting. in which m_compute_context is set by: I'll keep watching. |
I think the issue is the following:
//Edit could you try not creating your own context but using the context provided by boost::compute? or is this not possible in your application? |
I have to create my own context because I write some complex kernels, and I need to use boost.compute and viennacl. So I need to pass the wrapper of my cl_context, cl_device and cl_mem etc. to boost.compute and viennacl. |
this was just to test whether this fixes the problem (so that we know that this is the culprit). you could query device, context and queue using boost::compute::system instead of providing your own.
|
Thanks.
|
Hi. I use the most recent develop branch. Here's my problem description:
I'm a developer of a software. After adding some codes of boost.compute, the software would crash (program stopped working) after exiting. Actually, all boost.compute objects should be destructed after use so that there shouldn't be crash problem after exiting the whole software. The software uses other 3D librarys like vtk to display 3D mesh. When exiting, it has a memory release mechanism to release GPU memory. So I think the problem may be repetitive release of GPU memory. And there could really still be some memory leak problem.
After trying some tests, I found that the the exit crash happens when the following codes are used:
cl::Buffer *m_dev_sampleKeys;
boost::compute::buffer cbSampleKeys((*m_dev_sampleKeys)());
boost::compute::buffer_iterator<cl_ulong> iter =
boost::compute::make_buffer_iterator<cl_ulong>(cbSampleKeys, 0);
boost::compute::sort(
iter,
iter + m_nbSamples,
m_compute_queue
);
I have to note that all these boost.compute codes are run in a class object, which will be destructed immediately after use. So in normal case, it should not affect the proccess in software exiting.
So I guess there really may be some problems in buffer or buffer_iterator or sorting. Could you check them?
The text was updated successfully, but these errors were encountered: