]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
debuginfod: Tweak groom cycle for memory freeing
authorFrank Ch. Eigler <fche@redhat.com>
Mon, 25 Nov 2019 21:47:18 +0000 (16:47 -0500)
committerFrank Ch. Eigler <fche@redhat.com>
Mon, 25 Nov 2019 21:51:24 +0000 (16:51 -0500)
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>
debuginfod/ChangeLog
debuginfod/debuginfod.cxx

index a1d17b5f9a236dbf1eac04f97f788bb55dafc81f..4df45d83edd02a79faab608e2b432716c1da8e40 100644 (file)
@@ -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.
index cb0e1f3bf0a4f540c474c3f224817789b9bddbf5..aa7ffcf662aaa389489bd9f51c4b3b5bdfb12487 100644 (file)
@@ -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;