After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687765 - Memory usage increases when using query_position or query_duration
Memory usage increases when using query_position or query_duration
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-11-06 14:56 UTC by Andrew Hayzen
Modified: 2015-03-10 21:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case showing the issue (2.73 KB, text/x-java)
2012-11-06 14:56 UTC, Andrew Hayzen
Details
Valgrind of playing song for 10 seconds (997.02 KB, text/x-log)
2012-11-07 15:13 UTC, Andrew Hayzen
Details
Valgrind of playing song for 30 seconds with extra param (190.00 KB, application/x-lzma)
2012-11-07 21:37 UTC, Andrew Hayzen
Details
New valgrind log (3.82 KB, text/plain)
2014-08-19 06:52 UTC, Simon Feltman
Details

Description Andrew Hayzen 2012-11-06 14:56:40 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
Comment 1 Tim-Philipp Müller 2012-11-07 14:58:05 UTC
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).
Comment 2 Tim-Philipp Müller 2012-11-07 15:00:08 UTC
Also see bug #687493 btw (another python/leak issue).
Comment 3 Andrew Hayzen 2012-11-07 15:13:15 UTC
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
Comment 4 Tim-Philipp Müller 2012-11-07 16:22:43 UTC
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?
Comment 5 Tim-Philipp Müller 2012-11-07 16:25:53 UTC
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)
Comment 6 Andrew Hayzen 2012-11-07 21:37:31 UTC
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 :)
Comment 7 Tim-Philipp Müller 2012-11-08 00:24:13 UTC
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.
Comment 8 Andrew Hayzen 2012-11-08 00:37:22 UTC
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
Comment 9 Andrew Hayzen 2012-11-08 00:52:35 UTC
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
Comment 10 Tim-Philipp Müller 2013-01-05 15:10:46 UTC
Sorry, I should've moved this to the right component, since the leak is not in GStreamer as far as I can tell.
Comment 11 Simon Feltman 2014-08-19 06:52:15 UTC
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.
Comment 12 André Klapper 2015-02-07 17:18:20 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 13 Dieter Verfaillie 2015-03-10 21:06:32 UTC
(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.