We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d84f93 commit 9ae6f6cCopy full SHA for 9ae6f6c
value.go
@@ -564,6 +564,11 @@ func (vlog *valueLog) rewrite(f *logFile, tr trace.Trace) error {
564
565
ne.Value = append([]byte{}, e.Value...)
566
es := int64(ne.estimateSize(vlog.opt.ValueThreshold))
567
+ // Consider size of value as well while considering the total size
568
+ // of the batch. There have been reports of high memory usage in
569
+ // rewrite because we don't consider the value size. See #1292.
570
+ es += int64(len(e.Value))
571
+
572
// Ensure length and size of wb is within transaction limits.
573
if int64(len(wb)+1) >= vlog.opt.maxBatchCount ||
574
size+es >= vlog.opt.maxBatchSize {
0 commit comments