]> code.delx.au - pulseaudio/commitdiff
reduce needlessly large gdbm cache a bit
authorLennart Poettering <lennart@poettering.net>
Thu, 28 Aug 2008 23:48:31 +0000 (01:48 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 28 Aug 2008 23:48:31 +0000 (01:48 +0200)
src/modules/module-device-restore.c
src/modules/module-stream-restore.c

index 920b4517b8167399e7add6a07222fbb91aa61053..86a788104544ed2ccc0d41d4deae1890486adaa6 100644 (file)
@@ -288,6 +288,7 @@ int pa__init(pa_module*m) {
     pa_source *source;
     uint32_t idx;
     pa_bool_t restore_volume = TRUE, restore_muted = TRUE;
+    int gdbm_cache_size;
 
     pa_assert(m);
 
@@ -337,6 +338,10 @@ int pa__init(pa_module*m) {
         goto fail;
     }
 
+    /* By default the cache of gdbm is rather large, let's reduce it a bit to save memory */
+    gdbm_cache_size = 10;
+    gdbm_setopt(u->gdbm_file, GDBM_CACHESIZE, &gdbm_cache_size, sizeof(gdbm_cache_size));
+
     pa_log_info("Sucessfully opened database file '%s'.", fname);
     pa_xfree(fname);
 
index 37e8b067905678c97a6844cdf921bc35ba96b30e..47f5d83680a79a892558ede6fed73d170a5de48b 100644 (file)
@@ -686,6 +686,7 @@ int pa__init(pa_module*m) {
     pa_source_output *so;
     uint32_t idx;
     pa_bool_t restore_device = TRUE, restore_volume = TRUE, restore_muted = TRUE;
+    int gdbm_cache_size;
 
     pa_assert(m);
 
@@ -746,6 +747,10 @@ int pa__init(pa_module*m) {
         goto fail;
     }
 
+    /* By default the cache of gdbm is rather large, let's reduce it a bit to save memory */
+    gdbm_cache_size = 10;
+    gdbm_setopt(u->gdbm_file, GDBM_CACHESIZE, &gdbm_cache_size, sizeof(gdbm_cache_size));
+
     pa_log_info("Sucessfully opened database file '%s'.", fname);
     pa_xfree(fname);