Memory leaks

So I’ve finished coding the algorythm, however I’ve got some memory leaks or something.
My algorithm utilizes 3 loops and inside the most interior I’m using opencl. For the first loop it uses the highest number of variables and every loop i construct new object for whole maths in the same object name.
The problem is that every loop java process allocates more and more memory and I’ can’t understand why.
For example java profiler shows stable number oof 12 live jocl pointers while allocated number rises constantly.
Where to start with debugging this?
My app should work on about 64MB while it can allocate up to 2,5GB and then gets killed by windows…


It’s hard to tell what’s wrong there, when you added some JOCL core into a larger program. So far I can conly give the quite … generic but unspecific answer that for every clCreate* call there has to be a matching clRelease* call. Maybe you can sketch how the innermost loop looks like and how you set up and call OpenCL and the associated memory objects there.