From: Kern Sibbald Date: Tue, 2 Mar 2021 10:23:01 +0000 (+0100) Subject: Possible fix for SD high memory useage problem X-Git-Tag: Release-11.0.2~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed6877d3f4679aef4b18ae25ccf6b62fcf9f9124;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 5416873a8..694e66796 100644 --- a/bacula/src/stored/spool.c +++ b/bacula/src/stored/spool.c @@ -304,6 +304,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;