From: Kern Sibbald Date: Tue, 2 Mar 2021 10:23:01 +0000 (+0100) Subject: Possible fix for SD high memory useage problem X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37d345271c9f675160da0258298fdc4464790047;p=thirdparty%2Fbacula.git Possible fix for SD high memory useage problem --- diff --git a/bacula/src/stored/spool.c b/bacula/src/stored/spool.c index 9e0206749..f1dfabddc 100644 --- a/bacula/src/stored/spool.c +++ b/bacula/src/stored/spool.c @@ -302,6 +302,10 @@ static bool despool_data(DCR *dcr, bool commit) dcr->block = block; /* reset block */ +#if defined(HAVE_POSIX_FADVISE) && defined(POSIX_FADV_DONTNEED) + posix_fadvise(rdcr->spool_fd, 0, 0, POSIX_FADV_DONTNEED); +#endif + lseek(rdcr->spool_fd, 0, SEEK_SET); /* rewind */ if (ftruncate(rdcr->spool_fd, 0) != 0) { berrno be;