-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: shouldn't all instances of Pointer be deallocated to release native memory? #1337
Comments
Also i can't seem to find any release of memory for these two lines: javacv/src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java Lines 167 to 168 in 6cc1da8
Im guessing the releaseUnsafe method should call av_free_packet()? |
The first one doesn't cause allocation of any native memory, so that's alright. As for Are you having any issues with a memory leak somewhere? |
Well, im not sure. I think maybe I have fixed it, but needs further testing :) Any hints for how to track down memory leaks in JNI? so far I have tried BCC's memleak utility. but all in all, allocations looks fairly good. I've also tried using AspectJ and instrumenting JavaCPP's Pointer class and spying on set on the address field and using that information to create a summary of allocs & deallocs, not the greatest set of results though.. Haven't tried valgrind yet, but i guess that will be next if i still see crashes due to memory. |
If we set, for example, the "org.bytedeco.javacpp.logger.debug" system
property to "true", it will display allocations and deallocations on the
console, but yes, we need some other tool to analyze that log. If you
create some Java code for that, please send a pull request to have it
integrated into JavaCPP itself! Thanks
|
BTW, I think I've fixed all the memory leaks occurring in |
PointerBufferPoolMXBean from @matteodg released with JavaCPP 1.5.4 should make it easier to debug. |
I see that this is not the case for this line, is this causing a memory leak?
javacv/src/main/java/org/bytedeco/javacv/OpenCVFrameConverter.java
Line 93 in da3bb9c
The text was updated successfully, but these errors were encountered: