boostorg / boostorg/compute

Memory leak problem

Open
#785 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.7k
Forks
340
PR merge metrics
No merged PRs in 30d

Description

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 iter =
boost::compute::make_buffer_iterator(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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.