java - coordinates conversion memory leak #56

wildman007 opened this Issue Feb 8, 2012 · 0 comments


None yet
1 participant


there is a memory leak in jni methods

The arrays aProjective and aRealWorld are allocated each time these methods are called, however they are not deleted/freed at the end of the method. As a result, when converting coordinates in every frame, Java will quickly run out of memory.

I've tried to fix this by adding
delete[] aRealWorld;
delete[] aProjective;
before the line with return XN_STATUS_OK; (1613 and 1633), although it fixes the memory leak, it slows down the program quite a lot.

Is there any solution to fix the memory leak and maintain the same speed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment