From 3076abc7441b608964f19217f1be10069573be4c Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Mon, 28 Jan 2019 23:01:52 -0800 Subject: [PATCH] Disable malloc_trim This avoids walking the entire heap multiple times for complex operations like readdir. This does not entirely eliminate the observed performance regression but does dramatically reduce s3fs CPU usage. References #935. Fixes #936. --- src/s3fs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/s3fs.h b/src/s3fs.h index 142d6e6..8bcd165 100644 --- a/src/s3fs.h +++ b/src/s3fs.h @@ -51,7 +51,8 @@ static const int64_t FIVE_GB = 5LL * 1024LL * 1024LL * 1024LL; #include #define DISPWARN_MALLOCTRIM(str) -#define S3FS_MALLOCTRIM(pad) malloc_trim(pad) +// malloc_trim disabled due to performance overhead with many threads/heaps +#define S3FS_MALLOCTRIM(pad) #define S3FS_XMLFREEDOC(doc) \ { \ xmlFreeDoc(doc); \