Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

内存占用300多兆,正常吗 #31

Open
twonesix opened this issue Jun 7, 2017 · 4 comments
Open

内存占用300多兆,正常吗 #31

twonesix opened this issue Jun 7, 2017 · 4 comments

Comments

@twonesix
Copy link

twonesix commented Jun 7, 2017

加载完文件项目内存占用一直300多

@eruca
Copy link

eruca commented Jun 8, 2017

正常

@xuanyue202
Copy link

有没有考虑做一下内存优化,这个占用有点大啊

@wuknet
Copy link

wuknet commented Sep 13, 2019

我也是这样,希望能优化一下。

@Mignet
Copy link

Mignet commented Aug 14, 2020

i got a error
2020/08/14 15:51:16 载入sego词典 data/dictionary.txt
fatal error: runtime: out of memory

runtime stack:
runtime.throw(0x513b5a, 0x16)
/usr/lib/golang/src/runtime/panic.go:774 +0x72
runtime.sysMap(0xc00c000000, 0x4000000, 0x5fcf58)
/usr/lib/golang/src/runtime/mem_linux.go:169 +0xc5
runtime.(*mheap).sysAlloc(0x5e5800, 0x2000000, 0x0, 0x7f730e3ee228)
/usr/lib/golang/src/runtime/malloc.go:701 +0x1cd
runtime.(*mheap).grow(0x5e5800, 0x1000, 0xc0ffffffff)
/usr/lib/golang/src/runtime/mheap.go:1255 +0xa3
runtime.(*mheap).allocSpanLocked(0x5e5800, 0x1000, 0x5fcf68, 0x7ffd851a61f0)
/usr/lib/golang/src/runtime/mheap.go:1170 +0x266
runtime.(*mheap).alloc_m(0x5e5800, 0x1000, 0x5e0101, 0x7ffd851a61c8)
/usr/lib/golang/src/runtime/mheap.go:1022 +0xc2
runtime.(*mheap).alloc.func1()
/usr/lib/golang/src/runtime/mheap.go:1093 +0x4c
runtime.(*mheap).alloc(0x5e5800, 0x1000, 0xc000010101, 0xc000000180)
/usr/lib/golang/src/runtime/mheap.go:1092 +0x8a
runtime.largeAlloc(0x2000000, 0xc000420101, 0xc000036701)
/usr/lib/golang/src/runtime/malloc.go:1138 +0x97
runtime.mallocgc.func1()
/usr/lib/golang/src/runtime/malloc.go:1033 +0x46
runtime.systemstack(0x4531e4)
/usr/lib/golang/src/runtime/asm_amd64.s:370 +0x66
runtime.mstart()
/usr/lib/golang/src/runtime/proc.go:1146

goroutine 1 [running]:
runtime.systemstack_switch()
/usr/lib/golang/src/runtime/asm_amd64.s:330 fp=0xc0000689a0 sp=0xc000068998 pc=0x4532e0
runtime.mallocgc(0x2000000, 0x4f36a0, 0x7f730e3df001, 0xc000000180)
/usr/lib/golang/src/runtime/malloc.go:1032 +0x895 fp=0xc000068a40 sp=0xc0000689a0 pc=0x40b9f5
runtime.makeslice(0x4f36a0, 0x200000, 0x200000, 0x43e6ec)
/usr/lib/golang/src/runtime/slice.go:49 +0x6c fp=0xc000068a70 sp=0xc000068a40 pc=0x43e6ec
github.com/adamzy/cedar-go.(*cedar).addBlock(0xc000090000, 0xfff)
/data/gotowork/src/github.com/adamzy/cedar-go/cedar.go:136 +0x243 fp=0xc000068ad8 sp=0xc000068a70 pc=0x4c5463
github.com/adamzy/cedar-go.(*cedar).findPlaces(0xc000090000, 0xc00a57c480, 0x4, 0x101, 0x4)
/data/gotowork/src/github.com/adamzy/cedar-go/cedar.go:331 +0x192 fp=0xc000068b28 sp=0xc000068ad8 pc=0x4c6362
github.com/adamzy/cedar-go.(*cedar).resolve(0xc000090000, 0x17b17, 0xf29c7, 0x4b0de9, 0xc00a573906)
/data/gotowork/src/github.com/adamzy/cedar-go/cedar.go:350 +0x63b fp=0xc000068bc8 sp=0xc000068b28 pc=0x4c6a5b
github.com/adamzy/cedar-go.(*cedar).follow(0xc000090000, 0x17b17, 0xc00a5699e9, 0x17b17)
/data/gotowork/src/github.com/adamzy/cedar-go/cedar.go:98 +0x154 fp=0xc000068c10 sp=0xc000068bc8 pc=0x4c51f4
github.com/adamzy/cedar-go.(*cedar).get(0xc000090000, 0xc00a573900, 0x9, 0x40, 0x0, 0x6, 0xc000011280)
/data/gotowork/src/github.com/adamzy/cedar-go/cedar.go:78 +0x53 fp=0xc000068c50 sp=0xc000068c10 pc=0x4c4f13
github.com/adamzy/cedar-go.(*Cedar).Insert(0xc00000e550, 0xc00a573900, 0x9, 0x40, 0x5fa78, 0x532ce0, 0xc000011280)
/data/gotowork/src/github.com/adamzy/cedar-go/api.go:87 +0x93 fp=0xc000068c98 sp=0xc000068c50 pc=0x4c4a53
github.com/huichen/sego.(*Dictionary).addToken(0xc000060a50, 0xc00a577720, 0x3, 0x3, 0x5, 0x0, 0xc00a56997a, 0x2, 0x0, 0x0, ...)
/data/gotowork/src/github.com/huichen/sego/dictionary.go:40 +0xc8 fp=0xc000068d00 sp=0xc000068c98 pc=0x4ca4a8
github.com/huichen/sego.(*Segmenter).LoadDictionary(0xc000068f38, 0x51550f, 0x1e)
/data/gotowork/src/github.com/huichen/sego/segmenter.go:90 +0x306 fp=0xc000068ef8 sp=0xc000068d00 pc=0x4caa96
main.main()
/root/segohi/hi.go:10 +0x4d fp=0xc000068f60 sp=0xc000068ef8 pc=0x4ccc1d
runtime.main()
/usr/lib/golang/src/runtime/proc.go:203 +0x21e fp=0xc000068fe0 sp=0xc000068f60 pc=0x42c9de
runtime.goexit()
/usr/lib/golang/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc000068fe8 sp=0xc000068fe0 pc=0x455231
exit status 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants