Memory leak when opening PDF as a byte array
The library contains a memory leak when you open a PDF as a byte array.
I check the method nativeOpenMemDocument and found some weird memory copying code.
I've commented this code and memory leak has gone

TL;DR
I was running a 3 minutes autotest which opens the 50-pages PDF every 10 seconds.
This is the memory profiler results before the code commenting:
and you can clearly see that native memory grows and GC cannot clear it
This is the memory profiler results after the code commenting:
Now there is not such native memory issues. It stays relatively small and GC easily clears it
The issue was happening when I was calling the method PdfDocument newDocument(byte[] data, String password)
@barteksc Please share your thoughts on this issue? Please let me know whether it's fine that I've just commented these lines? Or is there some purpose for such memory copying? Glad to hear your comments. Thanks
UPDATE. After several tests I made a conclusion that the approach describe above is not acceptable. It works in some scenarios but also crashes in others (I cannot describe the details here because of the NDA)
After some research, I created a new code version that works in all the scenarios.
These are the changes that I made:

The whole code is here: mainJNILib.txt
@barteksc Glad to hear your opinion Thanks
@ViktorSkabiak You should create a pull request to fix this issue.
@AhmerAfzal1 Should I also include in the pull request the other changes required for the NDK to be able to build it with the latest Android Studio version? Such changes are:
- APP_PLATFORM = android-19 // modern NDK doesn't support the android-14 which is currently specified in the code
- removed mips and mips64 support // the same reason as above
@AhmerAfzal1 Should I also include in the pull request the other changes required for the NDK to be able to build it with the latest Android Studio version? Such changes are:
- APP_PLATFORM = android-19 // modern NDK doesn't support the android-14 which is currently specified in the code
- removed mips and mips64 support // the same reason as above
It's best to create a pull request that includes your latest change to this repo. Make it easy for authors and other users to see the new changing and fixed bugs, always make a pull request in which you participate improves this great library.