summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2016-04-04 10:13:09 -0400
committerKeith Bostic <keith@wiredtiger.com>2016-04-04 10:13:09 -0400
commitaf4e3f14bd51f3c4149f64bcf4e2e249c61c5136 (patch)
tree6888f6f29584df1161e45fc5763a36a385ae52b1
parent659c977eb08d9c08ef903f5d876ac242daf424cc (diff)
downloadmongo-af4e3f14bd51f3c4149f64bcf4e2e249c61c5136.tar.gz
WT-2531: in-memory tables are wasting space in truncation
Don't truncate the file when running in-memory, it will allocate relatively large chunks of buffer memory in the underlying OS layer that we'll never use.
-rw-r--r--src/block/block_ckpt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/block/block_ckpt.c b/src/block/block_ckpt.c
index a0aadb43b93..a861a21876b 100644
--- a/src/block/block_ckpt.c
+++ b/src/block/block_ckpt.c
@@ -135,8 +135,11 @@ __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block,
* that was done when the checkpoint was first written (re-writing the
* checkpoint might possibly make it relevant here, but it's unlikely
* enough I don't bother).
+ *
+ * If in-memory, we don't read or write the object, and the truncate
+ * will unnecessarily allocate buffer space.
*/
- if (!checkpoint) {
+ if (!checkpoint && !F_ISSET(S2C(session), WT_CONN_IN_MEMORY)) {
/*
* The truncate might fail if there's a file mapping (if there's
* an open checkpoint on the file), that's OK.