LWN.net Logo

ConnMan 1.0 released

ConnMan 1.0 released

Posted May 17, 2012 19:38 UTC (Thu) by zlynx (subscriber, #2285)
In reply to: ConnMan 1.0 released by alexl
Parent article: ConnMan 1.0 released

If I recall correctly from when I looked at some code 5 years ago...

Isn't gobject that abomination that contains 5 or 6 pointers to mostly useless information and causes any data structure that uses it to immediately bloat to over 100 MB in size?

5 64-bit pointers is 40 bytes before even including any information.

That is how I remember it anyway. I was trying to figure out how some new version of software went from 5 MB of resident set to over 100 MB back when my laptop had only 1 GB RAM.


(Log in to post comments)

ConnMan 1.0 released

Posted May 22, 2012 10:20 UTC (Tue) by jamesh (guest, #1159) [Link]

Try 2 pointers and an int. One of those pointers is a reference to the class and the integer holds the reference count for the object, which you'd expect if you're using reference count based memory management and virtual methods.

The other pointer can point to a GData structure that will be allocated if you use various GObject features (e.g. weak references).

I won't deny that it adds some memory overhead over a bare structure, but it is for features people generally use.

ConnMan 1.0 released

Posted May 22, 2012 16:04 UTC (Tue) by zlynx (subscriber, #2285) [Link]

I must have been thinking of GObjects stored in a GTree or a GList.

ConnMan 1.0 released

Posted May 23, 2012 1:42 UTC (Wed) by jamesh (guest, #1159) [Link]

I agree that in some cases something like Linux's linked list implementation that embeds in the parent structure would save memory.

But the point is moot in the context of ConnMan: while they aren't using GObject, they are using glibs ADTs such as GSList.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds