Skip to content

Commit

Permalink
Merge pull request #1123 from Agoric/skip-unnecessary-writemap
Browse files Browse the repository at this point in the history
Don't use the LMDB `useWritemap` option if we know we don't need it
  • Loading branch information
FUDCo authored May 20, 2020
2 parents 9f564f6 + c272e43 commit 81eb6ba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/swing-store-lmdb/lmdbSwingStore.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from 'fs';
import os from 'os';
import path from 'path';

import lmdb from 'node-lmdb';
Expand Down Expand Up @@ -27,7 +28,12 @@ function makeSwingStore(dirPath, forceReset = false) {
lmdbEnv.open({
path: dirPath,
mapSize: 2 * 1024 * 1024 * 1024, // XXX need to tune this
useWritemap: true,
// Turn off useWritemap on the Mac. The userWritemap option is currently
// required for LMDB to function correctly on Linux running under WSL, but
// we don't yet have a convenient recipe to probe our environment at
// runtime to distinguish that species of Linux from the others. For now
// we're running our benchmarks on Mac, so this will do for the time being.
useWritemap: os.platform() !== 'darwin',
});

let dbi = lmdbEnv.openDbi({
Expand Down

0 comments on commit 81eb6ba

Please sign in to comment.