Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

java - coordinates conversion memory leak #56

Open
wildman007 opened this Issue · 0 comments

1 participant

@wildman007

Hi,

there is a memory leak in jni methods
Java_org_OpenNI_NativeMethods_xnConvertProjectiveToRealWorld
Java_org_OpenNI_NativeMethods_xnConvertRealWorldToProjective

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
Something went wrong with that request. Please try again.