mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-02-09 09:17:28 +08:00
volume: fix memory leak during compaction
fix https://github.com/chrislusf/seaweedfs/issues/1222
This commit is contained in:
@@ -195,6 +195,8 @@ func runExport(cmd *Command, args []string) bool {
|
||||
vid := needle.VolumeId(*export.volumeId)
|
||||
|
||||
needleMap := needle_map.NewMemDb()
|
||||
defer needleMap.Close()
|
||||
|
||||
if err := needleMap.LoadFromIdx(path.Join(*export.dir, fileName+".idx")); err != nil {
|
||||
glog.Fatalf("cannot load needle map from %s.idx: %s", fileName, err)
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ func runFix(cmd *Command, args []string) bool {
|
||||
indexFileName := path.Join(*fixVolumePath, baseFileName+".idx")
|
||||
|
||||
nm := needle_map.NewMemDb()
|
||||
defer nm.Close()
|
||||
|
||||
vid := needle.VolumeId(*fixVolumeId)
|
||||
scanner := &VolumeFileScanner4Fix{
|
||||
|
||||
Reference in New Issue
Block a user