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 632447 - reduce static memory allocated by the registry
reduce static memory allocated by the registry
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other Linux
: Normal enhancement
: 0.10.32
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-10-18 11:27 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2010-12-03 08:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
use g_intern_string for static caps (2.27 KB, patch)
2010-10-18 11:27 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review
memory usage callgraph before (33.75 KB, image/svg+xml)
2010-10-20 10:52 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
  Details
memory usage callgraph after "g_intern_String for caps" patch (52.00 KB, image/svg+xml)
2010-10-20 10:52 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
  Details
script to do the meassurements (911 bytes, application/x-sh)
2010-10-20 10:59 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
  Details
use g_intern_string for interface names (1.09 KB, patch)
2010-10-20 11:33 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2010-10-18 11:27:32 UTC
Created attachment 172598 [details] [review]
use g_intern_string for static caps

The registry objects statically allocate quite some memory. There are two big consumers of memory:
1.) the registry-object instance (GstPluginFeature, ...)
2.) the strings (names, klasses, descriptions, ...)

On 2.) we already use g_intern_string for a few of them. 1.) could be solved in 0.11 by e.g considering GstMiniObject.

The attached patch uses g_intern_string also for static caps. This lowers the allocated memory on my system from 1683kb to 1233kb.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2010-10-18 11:49:21 UTC
On 1.) we're adding GstPlugin and GstPluginFeature instances to the registry. Neither of them has Properties nor Signals. I'll prototype this.
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2010-10-20 10:52:10 UTC
Created attachment 172825 [details]
memory usage callgraph before
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2010-10-20 10:52:55 UTC
Created attachment 172826 [details]
memory usage callgraph after "g_intern_String for caps" patch
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2010-10-20 10:59:56 UTC
Created attachment 172827 [details]
script to do the meassurements
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2010-10-20 11:06:23 UTC
Just to support the patch:
gstelementfactory.c:272: newt->static_caps.string = g_intern_string (caps_string);
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2010-10-20 11:07:33 UTC
(ignore comment 5 - that is part of the patch).
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2010-10-20 11:33:00 UTC
Created attachment 172828 [details] [review]
use g_intern_string for interface names