GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
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
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?