JVM blocked when using gst1-java-core
silver
sxhsxhsxh66 at gmail.com
Thu Mar 23 10:09:51 UTC 2017
Neil C Smith wrote
> Hi,
>
> On Wed, 22 Mar 2017 at 08:57 silver <
> sxhsxhsxh66@
> > wrote:
>
>> I tried to test the stability of my application so I programmatically
>> open
>> and close the window again and again. But always after thousands
>> iterations,
>> no response from JVM but no special errors (neither gstreamer nor java)
>> shown in console. I assume that it encountered a deadlock on gstreamer
>> level
>> but I cannot find any solution to debug or even solve it. Hope you guys
>> can
>> help me.
>>
>
> Have you tried profiling and a thread dump on the Java side? When
> updating
> the 0.10 bindings for gst1-java-core I fixed a load of memory leaks, but
> it's possible your code is finding another one. Is memory usage
> increasing? Are any particular objects not being garbage collected? Does
> the thread dump show a potential deadlock inside the JVM?
>
> Note that you should probably be calling buffer.map(true) - the boolean is
> a shortcut for mapping the buffer with the write flag.
>
> I'm not sure what your stopFromNeedData() call is doing, but it should
> probably use Gst,invokeLater().
>
> Best wishes.
>
> Neil
> --
> Neil C Smith
> Artist & Technologist
> www.neilcsmith.net
>
> Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at .freedesktop
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Thanks for your response. I'm always trying the profiler in visualVM but it
seems not able to connect to the jvm and I don't know why. But I'm sure that
the memory usage is relatively stable.
I'm trying your propose of invokeLater() but the test really takes time :/
In addition, I think I should mention my process of pipeline:
*Before*: 1. when opening the window, I did
pipe.ready()(GST_STATE_NULL->GST_STATE_READY) and then
pipe.play()(GST_STATE_READY->GST_STATE_PAUSED->GST_STATE_PLAYING)
2. when closing the video or it runs out of time, I did
pipe.stop()(GST_STATE_PLAYING->GST_STATE_PAUSED->GST_STATE_READY->GST_STATE_NULL)
*Now*(the last test): I comment pipe.stop()
I don't know which is more correct or both are OK or none. The last time I
tested, it ended at the 9000th iteration and then no response. In the
console I could see that when opening the windows,it was changing the state
element by element but just casually it died.
Last logs for state:
INFOS: Source = autoaudiosink-actual-sink-directsound message =
GstMessageStateChanged, old-state=(GstState)GST_STATE_PLAYING,
new-state=(GstState)GST_STATE_PAUSED,
pending-state=(GstState)GST_STATE_VOID_PENDING;
INFOS: Source = autoaudiosink message = GstMessageStateChanged,
old-state=(GstState)GST_STATE_PLAYING, new-state=(GstState)GST_STATE_PAUSED,
pending-state=(GstState)GST_STATE_VOID_PENDING;
INFOS: Source = volume message = GstMessageStateChanged,
old-state=(GstState)GST_STATE_PLAYING, new-state=(GstState)GST_STATE_PAUSED,
pending-state=(GstState)GST_STATE_VOID_PENDING;
INFOS: Source = faad message = GstMessageStateChanged,
old-state=(GstState)GST_STATE_PLAYING, new-state=(GstState)GST_STATE_PAUSED,
pending-state=(GstState)GST_STATE_VOID_PENDING;
INFOS: Source = aacparse message = GstMessageStateChanged,
old-state=(GstState)GST_STATE_PLAYING, new-state=(GstState)GST_STATE_PAUSED,
pending-state=(GstState)GST_STATE_VOID_PENDING;
INFOS: Source = queue message = GstMessageStateChanged,
old-state=(GstState)GST_STATE_PLAYING, new-state=(GstState)GST_STATE_PAUSED,
pending-state=(GstState)GST_STATE_VOID_PENDING;
INFOS: Source = Audio Bin message = GstMessageStateChanged,
old-state=(GstState)GST_STATE_PLAYING, new-state=(GstState)GST_STATE_PAUSED,
pending-state=(GstState)GST_STATE_VOID_PENDING;
INFOS: Source = GstVideoComponent message = GstMessageStateChanged,
old-state=(GstState)GST_STATE_PLAYING, new-state=(GstState)GST_STATE_PAUSED,
pending-state=(GstState)GST_STATE_VOID_PENDING;
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/JVM-blocked-when-using-gst1-java-core-tp4682337p4682368.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list