|
|
@ -160,8 +160,15 @@ func New(file string, cache int, handles int, namespace string, readonly bool, e |
|
|
|
// including a frozen memory table and another live one.
|
|
|
|
// including a frozen memory table and another live one.
|
|
|
|
memTableLimit := 2 |
|
|
|
memTableLimit := 2 |
|
|
|
memTableSize := cache * 1024 * 1024 / 2 / memTableLimit |
|
|
|
memTableSize := cache * 1024 * 1024 / 2 / memTableLimit |
|
|
|
if memTableSize > maxMemTableSize { |
|
|
|
|
|
|
|
memTableSize = maxMemTableSize |
|
|
|
// The memory table size is currently capped at maxMemTableSize-1 due to a
|
|
|
|
|
|
|
|
// known bug in the pebble where maxMemTableSize is not recognized as a
|
|
|
|
|
|
|
|
// valid size.
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// TODO use the maxMemTableSize as the maximum table size once the issue
|
|
|
|
|
|
|
|
// in pebble is fixed.
|
|
|
|
|
|
|
|
if memTableSize >= maxMemTableSize { |
|
|
|
|
|
|
|
memTableSize = maxMemTableSize - 1 |
|
|
|
} |
|
|
|
} |
|
|
|
db := &Database{ |
|
|
|
db := &Database{ |
|
|
|
fn: file, |
|
|
|
fn: file, |
|
|
|