|Summary:||allow caches to be disabled for memory-constrained environments|
|Product:||dbus||Reporter:||Simon McVittie <smcv>|
|Component:||core||Assignee:||Simon McVittie <smcv>|
|Status:||RESOLVED MOVED||QA Contact:||D-Bus Maintainers <dbus>|
|i915 platform:||i915 features:|
Add a configure option to disable the message cache
Add a configure option to disable the DBusMemPool for linked-list links
Add a configure option to disable DBusMemPool for hash table entries
Replace vestigial efence support with --with-dbus-daemon-malloc
Description Simon McVittie 2011-03-07 10:33:29 UTC
Comment 1 Simon McVittie 2011-03-07 10:33:59 UTC
Created attachment 44208 [details] [review] Add a configure option to disable the message cache The option is called "enable" even though the default is on, to avoid confusing people with double-negatives.
Comment 2 Simon McVittie 2011-03-07 10:34:15 UTC
Created attachment 44209 [details] [review] Add a configure option to disable the DBusMemPool for linked-list links
Comment 3 Simon McVittie 2011-03-07 10:34:31 UTC
Created attachment 44210 [details] [review] Add a configure option to disable DBusMemPool for hash table entries
Comment 4 Simon McVittie 2011-03-07 10:36:05 UTC
Created attachment 44211 [details] [review] Replace vestigial efence support with --with-dbus-daemon-malloc I've had good empirical results with jemalloc (aka FreeBSD malloc), which seems to be more effective at returning memory to the OS than glibc's modified ptmalloc2 while recovering from bus flooding. It does have more peak memory use, though, and slightly reduces throughput.
Comment 5 Colin Walters 2011-03-09 12:38:27 UTC
Review of attachment 44208 [details] [review]: Looks fine to me. In the big picture one problem I see with autoconf options is they don't say *why* you may want them (or not want them). Linux kernel style config is nice here where each option gets a paragraph.
Comment 6 Colin Walters 2011-03-09 12:41:00 UTC
Review of attachment 44209 [details] [review]: Hmm, is there a reason why one would want the message cache disabled but the linked list one enabled? Why not one global --disable-caches?
Comment 7 Colin Walters 2011-03-09 12:45:49 UTC
Review of attachment 44211 [details] [review]: This one definitely could use a comment; so you now can do: --with-dbus-daemon-malloc=/usr/lib/libefence.so ? Maybe add "(path to shared library)" to the help description?
Comment 8 Simon McVittie 2011-03-10 04:07:50 UTC
From further testing, these might not actually be as effective as I'd hoped; more testing required, sadly. The reason I made them all separate was largely to be able to play with different settings without repeatedly adding/removing patches.
Comment 9 Simon McVittie 2011-03-10 04:41:12 UTC
(In reply to comment #7) > Review of attachment 44211 [details] [review]: > > This one definitely could use a comment; so you now can do: > > --with-dbus-daemon-malloc=/usr/lib/libefence.so > > ? Maybe add "(path to shared library)" to the help description? The help description does say "--with-dbus-daemon-malloc=[linker flags]"; the argument is added to LDADD. In practice I've been using something like --with-dbus-daemon-malloc=/home/smcv/.../libjemalloc_pic.a; if using a shared object, "-lefence" or "-L/opt/efence/lib -lefence" would be more appropriate. It's difficult to get a clear description in one line; perhaps we could do with a description in INSTALL. On the other hand, anyone contemplating using these option should probably be looking at the source code (and profiling the results) anyway... if there's an obvious right answer for any of them we should just make it the default.
Comment 10 Simon McVittie 2012-02-21 08:41:01 UTC
Not actively being worked on. One day someone should profile how much these caches actually help: it's possible that they're just unnecessary complexity.
Comment 11 Simon McVittie 2012-02-21 08:42:06 UTC
Comment on attachment 44208 [details] [review] Add a configure option to disable the message cache As of the merge of Bug #37286, the message cache can be disabled at runtime for memory-leak debugging, if DBUS_BUILD_TESTS is set. I'm not sure whether any of these make sense for purposes other than debugging memory leaks.
Comment 12 GitLab Migration User 2018-10-12 21:08:45 UTC
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/43.