mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-22 05:47:23 +08:00
volume: fix memory leak during compaction
fix https://github.com/chrislusf/seaweedfs/issues/1222
This commit is contained in:
23
weed/storage/needle_map/memdb_test.go
Normal file
23
weed/storage/needle_map/memdb_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package needle_map
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/storage/types"
|
||||
)
|
||||
|
||||
func BenchmarkMemDb(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
for i := 0; i < b.N; i++ {
|
||||
nm := NewMemDb()
|
||||
|
||||
nid := types.NeedleId(345)
|
||||
offset := types.Offset{
|
||||
OffsetHigher: types.OffsetHigher{},
|
||||
OffsetLower: types.OffsetLower{},
|
||||
}
|
||||
nm.Set(nid, offset, 324)
|
||||
nm.Close()
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user