{"action":"closed","issue":{"url":"https://api.github.com/repos/chrislusf/seaweedfs/issues/371","repository_url":"https://api.github.com/repos/chrislusf/seaweedfs","labels_url":"https://api.github.com/repos/chrislusf/seaweedfs/issues/371/labels{/name}","comments_url":"https://api.github.com/repos/chrislusf/seaweedfs/issues/371/comments","events_url":"https://api.github.com/repos/chrislusf/seaweedfs/issues/371/events","html_url":"https://github.com/chrislusf/seaweedfs/issues/371","id":177620584,"number":371,"title":"weed compact: out of memory","user":{"login":"juliensobrier","id":473342,"avatar_url":"https://avatars.githubusercontent.com/u/473342?v=3","gravatar_id":"","url":"https://api.github.com/users/juliensobrier","html_url":"https://github.com/juliensobrier","followers_url":"https://api.github.com/users/juliensobrier/followers","following_url":"https://api.github.com/users/juliensobrier/following{/other_user}","gists_url":"https://api.github.com/users/juliensobrier/gists{/gist_id}","starred_url":"https://api.github.com/users/juliensobrier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliensobrier/subscriptions","organizations_url":"https://api.github.com/users/juliensobrier/orgs","repos_url":"https://api.github.com/users/juliensobrier/repos","events_url":"https://api.github.com/users/juliensobrier/events{/privacy}","received_events_url":"https://api.github.com/users/juliensobrier/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-18T00:46:40Z","updated_at":"2016-09-23T03:31:24Z","closed_at":"2016-09-23T03:31:24Z","body":"Whenever I run weedfs compact against a 30GB file, weedfs fails with the error \"fatal error: runtime: out of memory\". But it is not running out of RAM (9GB free out of 32GB) and disk space (30GB+ left). Memory usage seems to be constant around 2GB. When it fails, the newly compacted .cpd file is always 17GB, I'm using the latest version (0.70) AMD64.\r\n\r\nFull stack trace:\r\nI0917 15:06:33 32317 volume.go:110] loading index file 1266.idx readonly false\r\nfatal error: runtime: out of memory\r\n\r\nruntime stack:\r\nruntime.throw(0xdc4c60, 0x16)\r\n        /home/chris/apps/go/src/runtime/panic.go:530 +0x90\r\nruntime.sysMap(0xc822160000, 0xc0a80000, 0x12800077a00, 0x1184738)\r\n        /home/chris/apps/go/src/runtime/mem_linux.go:206 +0x9b\r\nruntime.(*mheap).sysAlloc(0x1169e40, 0xc0a80000, 0x0)\r\n        /home/chris/apps/go/src/runtime/malloc.go:429 +0x191\r\nruntime.(*mheap).grow(0x1169e40, 0x60540, 0x0)\r\n        /home/chris/apps/go/src/runtime/mheap.go:651 +0x63\r\nruntime.(*mheap).allocSpanLocked(0x1169e40, 0x6053d, 0x8b3518)\r\n        /home/chris/apps/go/src/runtime/mheap.go:553 +0x4f6\r\nruntime.(*mheap).alloc_m(0x1169e40, 0x6053d, 0xffffff0100000000, 0x7fa21fffedd0)\r\n        /home/chris/apps/go/src/runtime/mheap.go:437 +0x119\r\nruntime.(*mheap).alloc.func1()\r\n        /home/chris/apps/go/src/runtime/mheap.go:502 +0x41\r\nruntime.systemstack(0x7fa21fffede8)\r\n        /home/chris/apps/go/src/runtime/asm_amd64.s:307 +0xab\r\nruntime.(*mheap).alloc(0x1169e40, 0x6053d, 0x10100000000, 0x1)\r\n        /home/chris/apps/go/src/runtime/mheap.go:503 +0x63\r\nruntime.largeAlloc(0xc0a79778, 0xc800000001, 0x7fa2262cbc78)\r\n        /home/chris/apps/go/src/runtime/malloc.go:766 +0xb3\r\nruntime.mallocgc.func3()\r\n        /home/chris/apps/go/src/runtime/malloc.go:664 +0x33\r\nruntime.systemstack(0xc82001aa00)\r\n        /home/chris/apps/go/src/runtime/asm_amd64.s:291 +0x79\r\nruntime.mstart()\r\n        /home/chris/apps/go/src/runtime/proc.go:1048\r\n\r\ngoroutine 1 [running]:\r\nruntime.systemstack_switch()\r\n        /home/chris/apps/go/src/runtime/asm_amd64.s:245 fp=0xc8200ff790 sp=0xc8200ff788\r\nruntime.mallocgc(0xc0a79778, 0xaac740, 0x400000001, 0x0)\r\n        /home/chris/apps/go/src/runtime/malloc.go:665 +0x9eb fp=0xc8200ff868 sp=0xc8200ff790\r\nruntime.newarray(0xaac740, 0xc0a79778, 0xc8200ff998)\r\n        /home/chris/apps/go/src/runtime/malloc.go:798 +0xc9 fp=0xc8200ff8a8 sp=0xc8200ff868\r\nruntime.makeslice(0xa94900, 0xc0a79778, 0xc0a79778, 0x0, 0x0, 0x0)\r\n        /home/chris/apps/go/src/runtime/slice.go:32 +0x165 fp=0xc8200ff8f8 sp=0xc8200ff8a8\r\ngithub.com/chrislusf/seaweedfs/go/storage.(*Needle).ReadNeedleBody(0xc8200aea00, 0xc82016c0c8, 0x2, 0x4113ee788, 0xc0a79778, 0x0, 0x0)\r\n        /home/chris/dev/workspace/home/gopath/src/github.com/chrislusf/seaweedfs/go/storage/needle_read_write.go:242 +0x1db fp=0xc8200ff9c8 sp=0xc8200ff8f8\r\ngithub.com/chrislusf/seaweedfs/go/storage.ScanVolumeFile(0xd217f8, 0x1, 0x0, 0x0, 0xc8000004f2, 0x0, 0xc8200ffc10, 0xd21801, 0xc8200ffc28, 0x0, ...)\r\n        /home/chris/dev/workspace/home/gopath/src/github.com/chrislusf/seaweedfs/go/storage/volume.go:333 +0x631 fp=0xc8200ffb38 sp=0xc8200ff9c8\r\ngithub.com/chrislusf/seaweedfs/go/storage.(*Volume).copyDataAndGenerateIndexFile(0xc820188180, 0xc820790580, 0x8, 0xc820790588, 0x8, 0x0, 0x0)\r\n        /home/chris/dev/workspace/home/gopath/src/github.com/chrislusf/seaweedfs/go/storage/volume_vacuum.go:89 +0x347 fp=0xc8200ffc68 sp=0xc8200ffb38\r\ngithub.com/chrislusf/seaweedfs/go/storage.(*Volume).Compact(0xc820188180, 0x0, 0x0)\r\n        /home/chris/dev/workspace/home/gopath/src/github.com/chrislusf/seaweedfs/go/storage/volume_vacuum.go:24 +0x24d fp=0xc8200ffd08 sp=0xc8200ffc68\r\nmain.runCompact(0x11599a0, 0xc8200700f0, 0x0, 0x0, 0x0)\r\n        /home/chris/dev/workspace/home/gopath/src/github.com/chrislusf/seaweedfs/go/weed/compact.go:40 +0x1a9 fp=0xc8200ffdc8 sp=0xc8200ffd08\r\nmain.main()\r\n        /home/chris/dev/workspace/home/gopath/src/github.com/chrislusf/seaweedfs/go/weed/weed.go:78 +0x68d fp=0xc8200fff50 sp=0xc8200ffdc8\r\nruntime.main()\r\n        /home/chris/apps/go/src/runtime/proc.go:188 +0x2b0 fp=0xc8200fffa0 sp=0xc8200fff50\r\nruntime.goexit()\r\n        /home/chris/apps/go/src/runtime/asm_amd64.s:1998 +0x1 fp=0xc8200fffa8 sp=0xc8200fffa0\r\n\r\ngoroutine 17 [syscall, 50 minutes, locked to thread]:\r\nruntime.goexit()\r\n        /home/chris/apps/go/src/runtime/asm_amd64.s:1998 +0x1\r\n\r\ngoroutine 19 [chan receive, 1 minutes]:\r\ngithub.com/chrislusf/seaweedfs/go/glog.(*loggingT).flushDaemon(0x1162360)\r\n        /home/chris/dev/workspace/home/gopath/src/github.com/chrislusf/seaweedfs/go/glog/glog.go:883 +0x67\r\ncreated by github.com/chrislusf/seaweedfs/go/glog.init.1\r\n        /home/chris/dev/workspace/home/gopath/src/github.com/chrislusf/seaweedfs/go/glog/glog.go:410 +0x297\r\n\r\ngoroutine 34 [select, 50 minutes]:\r\ngithub.com/chrislusf/seaweedfs/go/stats.(*ServerStats).Start(0xc820186d40)\r\n        /home/chris/dev/workspace/home/gopath/src/github.com/chrislusf/seaweedfs/go/stats/stats.go:92 +0x464\r\ncreated by github.com/chrislusf/seaweedfs/go/weed/weed_server.init.1\r\n        /home/chris/dev/workspace/home/gopath/src/github.com/chrislusf/seaweedfs/go/weed/weed_server/common.go:27 +0x50\r\n\r\ngoroutine 35 [syscall, 50 minutes]:\r\nos/signal.signal_recv(0x0)\r\n        /home/chris/apps/go/src/runtime/sigqueue.go:116 +0x132\r\nos/signal.loop()\r\n        /home/chris/apps/go/src/os/signal/signal_unix.go:22 +0x18\r\ncreated by os/signal.init.1\r\n        /home/chris/apps/go/src/os/signal/signal_unix.go:28 +0x37\r\n\r\n"}}
{"actor":{"display_login":"chrislusf"}}