native memory still exists after Pipeline.close #249
Replies: 7 comments 5 replies
-
Please provide contextual information and a code example that demonstrates this problem, or this issue will be closed. This is not a general problem, so is being triggered by something specific to your usage or code. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply, I will upload a demo code later. |
Beta Was this translation helpful? Give feedback.
-
1, I execute the following command to run my demo, The heap capacity of the jvm is 3M. 2, The source code of my program is as follows: (where the keepAlive function is just to prevent the program from exiting)
3, Below I have 3 test results: |
Beta Was this translation helpful? Give feedback.
-
The code typesetting is a bit unfriendly, I rearranged it as follows for your convenience: public class App {
} |
Beta Was this translation helpful? Give feedback.
-
Looking forward to your reply, thank you very much. |
Beta Was this translation helpful? Give feedback.
-
There are a number of problems in your code, I'm not sure your assumption that all memory will be released is necessarily correct, and it's possible you're seeing some interaction with #244 caused by calling close() off the GStreamer event thread or directly after stop(). A few pointers -
Try looking at the structure of the various examples in https://github.com/gstreamer-java/gst1-java-examples Moving this into discussions. I don't believe it's a sign of a native memory leak. |
Beta Was this translation helpful? Give feedback.
-
I found that org.freedesktop.gstreamer.Buffer can close() to release native memory as long as it does not call disown. It seems that when calling close, it goes to org.freedesktop.gstreamer.glib.NativeObject.Handle.dispose -> disposeNativeHandle. So it can release native memory. When I just only new Pipeline() (no other operations such as addMany, play, etc.), the native memory grows, but why does calling Pipeline.close not release the native memory ? Can you have any code level guidance about release native memory ? In addition, No matter how many times System.gc() fails to release the native memory corresponding to the pipeline |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions