summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2019-11-25 16:47:18 -0500
committerFrank Ch. Eigler <fche@redhat.com>2019-11-25 16:51:24 -0500
commit5311b6bd2d412384a0407a9e19fcfed0df0e92bf (patch)
treee0e9d8b9a89721526fcf69df28e2e9bfd479f224
parentdc91887c4411a282790d15834fe5cae7d666ea40 (diff)
debuginfod: Tweak groom cycle for memory freeing
Use the sqlite3_db_release_memory() call periodically. It should have no effect except hopefully smaller server memory usage. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
-rw-r--r--debuginfod/ChangeLog5
-rw-r--r--debuginfod/debuginfod.cxx2
2 files changed, 7 insertions, 0 deletions
diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index a1d17b5f..4df45d83 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-25 Frank Ch. Eigler <fche@redhat.com>
+
+ * debuginfod.cxx (groom): Add a sqlite3_db_release_memory()
+ at the end of periodic grooming to try to shrink the process.
+
2019-11-24 Mark Wielaard <mark@klomp.org>
* debuginfod.cxx (test_webapi_sleep): Removed.
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index cb0e1f3b..aa7ffcf6 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -2357,6 +2357,8 @@ void groom()
database_stats_report();
+ sqlite3_db_release_memory(db); // shrink the process if possible
+
gettimeofday (&tv_end, NULL);
double deltas = (tv_end.tv_sec - tv_start.tv_sec) + (tv_end.tv_usec - tv_start.tv_usec)*0.000001;