]> git.sur5r.net Git - bacula/bacula/commitdiff
Improve mem pool garbage collection
authorKern Sibbald <kern@sibbald.com>
Wed, 15 Mar 2017 14:31:32 +0000 (15:31 +0100)
committerKern Sibbald <kern@sibbald.com>
Wed, 15 Mar 2017 14:31:32 +0000 (15:31 +0100)
bacula/src/dird/job.c
bacula/src/filed/job.c
bacula/src/lib/mem_pool.c
bacula/src/stored/fd_cmds.c

index 7558d362d71f3a26022cc9d7edc4b6087bbfbb52..60c70f18ad758a0886ae39327befbeec96362b86 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula(R) - The Network Backup Solution
 
-   Copyright (C) 2000-2015 Kern Sibbald
+   Copyright (C) 2000-2017 Kern Sibbald
 
    The original author of Bacula is Kern Sibbald, with contributions
    from many others, a complete list can be found in the file AUTHORS.
@@ -1467,6 +1467,8 @@ void dird_free_jcr(JCR *jcr)
 
    free_plugins(jcr);                 /* release instantiated plugins */
 
+   garbage_collect_memory_pool();
+
    Dmsg0(200, "End dird free_jcr\n");
 }
 
index bcc72b1b949a01320f0424f13f1ee86ae142c2d6..a5974e24d234c0bc165118400ce6ef6e07c80348 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula(R) - The Network Backup Solution
 
-   Copyright (C) 2000-2015 Kern Sibbald
+   Copyright (C) 2000-2017 Kern Sibbald
 
    The original author of Bacula is Kern Sibbald, with contributions
    from many others, a complete list can be found in the file AUTHORS.
index a2e7606889a0d0c6310a1a339ca4bdd2572612da..5d7028cb33bcc0546bb5426ec0f725d3daca3f8d 100644 (file)
@@ -375,7 +375,8 @@ void garbage_collect_memory_pool()
       return;
    }
    now = time(NULL);
-   if (now >= last_garbage_collection + garbage_interval) {
+   if (now >= last_garbage_collection + garbage_interval ||
+       sm_bytes > 500000) {
       last_garbage_collection = now;
       V(mutex);
       garbage_collect_memory();
index 630f5e04762fb5aa6afb601064abda2bd0add013..1b6bfe8787b583256f120ea9d7bddfac61ef95d2 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula(R) - The Network Backup Solution
 
-   Copyright (C) 2000-2016 Kern Sibbald
+   Copyright (C) 2000-2017 Kern Sibbald
 
    The original author of Bacula is Kern Sibbald, with contributions
    from many others, a complete list can be found in the file AUTHORS.
@@ -161,6 +161,7 @@ bail_out:
    Dmsg1(100, "==== %s", dir->msg);
    dir->signal(BNET_EOD);             /* send EOD to Director daemon */
    free_plugins(jcr);                 /* release instantiated plugins */
+   garbage_collect_memory_pool();
    return;
 }