Cleanup and Memory saving
Merge branch 'integrate-jni'