reduce needlessly large gdbm cache a bit

This commit is contained in:
Lennart Poettering 2008-08-29 01:48:31 +02:00
parent 450fe170a5
commit 54da71ef5d
2 changed files with 10 additions and 0 deletions

View file

@ -288,6 +288,7 @@ int pa__init(pa_module*m) {
pa_source *source; pa_source *source;
uint32_t idx; uint32_t idx;
pa_bool_t restore_volume = TRUE, restore_muted = TRUE; pa_bool_t restore_volume = TRUE, restore_muted = TRUE;
int gdbm_cache_size;
pa_assert(m); pa_assert(m);
@ -337,6 +338,10 @@ int pa__init(pa_module*m) {
goto fail; 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_log_info("Sucessfully opened database file '%s'.", fname);
pa_xfree(fname); pa_xfree(fname);

View file

@ -686,6 +686,7 @@ int pa__init(pa_module*m) {
pa_source_output *so; pa_source_output *so;
uint32_t idx; uint32_t idx;
pa_bool_t restore_device = TRUE, restore_volume = TRUE, restore_muted = TRUE; pa_bool_t restore_device = TRUE, restore_volume = TRUE, restore_muted = TRUE;
int gdbm_cache_size;
pa_assert(m); pa_assert(m);
@ -746,6 +747,10 @@ int pa__init(pa_module*m) {
goto fail; 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_log_info("Sucessfully opened database file '%s'.", fname);
pa_xfree(fname); pa_xfree(fname);