GNOME Bugzilla – Bug 687765
Memory usage increases when using query_position or query_duration
Last modified: 2015-03-10 21:06:32 UTC
Created attachment 228254 [details] Test case showing the issue Hi Python 3.2.3 GStreamer 1.0.1 I have noticed that the memory usage increases when retrieving the position or duration via query_position or query_duration. I have attached an example which shows the memory usage increasing by monitoring the position/duration with a delay of 1ms to emphasize the problem. Hope this can be resolved soon. Many thanks, Andy
I have tried this test case with: python 2.7.3 gobject-introspection 1.32.1 glib 2.32.4 GStreamer git master and could not see any major leakage. Could you provide a log with $ G_SLICE=always-malloc valgrind --leak-check=yes /usr/bin/python test.py 2>&1 | tee valgrind.log ? (You will probably need to implement EOS handling or shut down the pipeline cleanly some other way after a pre-defined amount of time or so).
Also see bug #687493 btw (another python/leak issue).
Created attachment 228375 [details] Valgrind of playing song for 10 seconds Hi This attachment shows the valgrind log while playing a song for a 10 second period. Please ask me if you need a long period. Thanks again, Andy
Could you make another log please, this time passing also --leak-check=full --show-reachable=yes to valgrind ? And perhaps run it for 30 seconds. You do pipeline.set_state (Gst.State.NULL) or whatever it's called at the end before exiting, right?
Oh, and could you also install the following packages: libglib2.0-0-dbg python3-gi-dbg (assuming you have python3-gi installed) python-gobject-dbg (assuming you have python-gobject installed)
Created attachment 228423 [details] Valgrind of playing song for 30 seconds with extra param Hi, I have run valgrind again with the extra parameters and let the player run for 30 seconds. The player is being stopped by calling self.player.set_state(Gst.State.NULL) and then Gtk.main_quit() to stop the main loop. I have also installed all of those packages you requested. Please ask if you need any more information, Many thanks, Andy Note: The attachment is in a .tar.lzma because it was too large to upload :)
Thanks. Let's concentrate on the biggest 'definitely lost' leak only, since the next one in the list is in a completely different league, and the large "possibly leaks" also don't look suspicious to me at first glance. It looks to me like these leaks come from gobject-introspection. ==4161== 464,328 bytes in 6,449 blocks are definitely lost in loss record 11,302 of 11,304 ==4161== at 0x4C2B3F8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==4161== by 0x7B3B6E0: g_malloc (gmem.c:159) ==4161== by 0x7B507D2: g_slice_alloc (gslice.c:1003) ==4161== by 0x7675BBE: ??? (in /usr/lib/libgirepository-1.0.so.1.0.0) ==4161== by 0x7460417: _pygi_marshal_from_py_interface_enum (pygi-marshal-from-py.c:1407) ==4161== by 0x745BC71: pygi_callable_info_invoke (pygi-invoke.c:502) ==4161== by 0x4686D1: PyEval_EvalFrameEx (ceval.c:4233) ==4161== by 0x460B82: PyEval_EvalCodeEx (ceval.c:3350) ==4161== by 0x466790: PyEval_EvalFrameEx (ceval.c:4019) ==4161== by 0x460612: PyEval_EvalCodeEx (ceval.c:3350) ==4161== by 0x4E988D: function_call.63128 (funcobject.c:629) ==4161== by 0x4B20B9: PyObject_Call (abstract.c:2149) What's your version of gobject-introspection ? (dpkg -l gobject-introspection) I checked the upstream git repository for diffs/commits, but didn't see anything stick out that might explain this. But I also can't make the line numbers match up with my versions, so maybe there's some patching going on or I have the version range completely wrong.
Hi $ dpkg -l gobject-introspection dpkg-query: no packages found matching gobject-introspection So I tried. $ apt-cache policy gobject-introspection gobject-introspection: Installed: (none) Candidate: 1.33.14-1 Version table: 1.33.14-1 0 500 http://gb.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages As you can see I don't have gobject-introspection installed? I have python3-gi installed if that is of any use? $ apt-cache policy python3-gi python3-gi: Installed: 3.4.0-1 Candidate: 3.4.0-1 Version table: *** 3.4.0-1 0 500 http://gb.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages 100 /var/lib/dpkg/status Hope this helps, Andy
Hi Just found this package, it may have the information required. $ apt-cache policy libgirepository-1.0-1 libgirepository-1.0-1: Installed: 1.33.14-1 Candidate: 1.33.14-1 Version table: *** 1.33.14-1 0 500 http://gb.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages 100 /var/lib/dpkg/status Andy
Sorry, I should've moved this to the right component, since the leak is not in GStreamer as far as I can tell.
Created attachment 283861 [details] New valgrind log I ran the test with glib, gst, and pygobject from git master today with the following command line: $ G_SLICE=always-malloc G_DEBUG=resident-modules valgrind --leak-check=full --show-possibly-lost=no --suppressions=../tests/python3.3.supp python3 ../bugs/687765.py (suppression file is found in pygobject/tests/python3.3.supp) The leak mentioned in comment #7 was from pygobject, but I don't see it these days. Lots of leaks have been fixed over the years so I think we can probably close this.
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
(In reply to Simon Feltman from comment #11) > The leak mentioned in comment #7 was from pygobject, but I don't see it > these days. Lots of leaks have been fixed over the years so I think we can > probably close this. Thanks for testing, let's close this as obsolete then.