fatal error: runtime: out of memory #871
Answered
by
Misaki030112
Misaki030112
asked this question in
Q&A
-
I followed the official documentation to install the golang environment, cloned the repository to my wsl environment, and ran go run main.go The following exception occurred ╭─[HN400046] as misaki in ~/dev/dice using Golang 1.23.0 on (master)✘✘✘ 09:56:32
╰─(ノ˚Д˚)ノ go run main.go
fatal error: runtime: out of memory
runtime stack:
runtime.throw({0x13bf8cd?, 0x2030a7?})
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/panic.go:1067 +0x48 fp=0x154d5136fc10 sp=0x154d5136fbe0 pc=0x46d3c8
runtime.sysMapOS(0xc000800000, 0x29bc00000)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mem_linux.go:168 +0x11b fp=0x154d5136fc50 sp=0x154d5136fc10 pc=0x415b9b
runtime.sysMap(0xc000800000, 0x29bc00000, 0x1e8cd28?)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mem.go:155 +0x34 fp=0x154d5136fc70 sp=0x154d5136fc50 pc=0x415574
runtime.(*mheap).grow(0x1e7cb20, 0x14dc94?)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mheap.go:1539 +0x236 fp=0x154d5136fce0 sp=0x154d5136fc70 pc=0x428756
runtime.(*mheap).allocSpan(0x1e7cb20, 0x14dc94, 0x0, 0x0)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mheap.go:1244 +0x1b0 fp=0x154d5136fd88 sp=0x154d5136fce0 pc=0x427dd0
runtime.(*mheap).alloc.func1()
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mheap.go:962 +0x5c fp=0x154d5136fdd0 sp=0x154d5136fd88 pc=0x42787c
runtime.systemstack(0x200000)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/asm_amd64.s:514 +0x4a fp=0x154d5136fde0 sp=0x154d5136fdd0 pc=0x4731ea
goroutine 1 gp=0xc0000061c0 m=5 mp=0xc000100008 [running]:
runtime.systemstack_switch()
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/asm_amd64.s:479 +0x8 fp=0xc000039c18 sp=0xc000039c08 pc=0x473188
runtime.(*mheap).alloc(0xc000039c78?, 0x418b76?, 0x0?)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mheap.go:956 +0x5b fp=0xc000039c60 sp=0xc000039c18 pc=0x4277db
runtime.(*mcache).allocLarge(0x100000000?, 0x29b927000, 0x0)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mcache.go:234 +0x87 fp=0xc000039cb0 sp=0xc000039c60 pc=0x4146a7
runtime.mallocgc(0x29b927000, 0x134c2c0, 0x1)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/malloc.go:1177 +0x5d0 fp=0xc000039d50 sp=0xc000039cb0 pc=0x468650
runtime.makechan(0xc000388930?, 0xbebc200)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/chan.go:108 +0xad fp=0xc000039d90 sp=0xc000039d50 pc=0x40712d
main.main()
/home/misaki/dev/dice/main.go:50 +0xd6 fp=0xc000039f50 sp=0xc000039d90 pc=0x12b28b6
runtime.main()
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:272 +0x28b fp=0xc000039fe0 sp=0xc000039f50 pc=0x43958b
runtime.goexit({})
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000039fe8 sp=0xc000039fe0 pc=0x4751a1
goroutine 2 gp=0xc000006c40 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:424 +0xce fp=0xc000084fa8 sp=0xc000084f88 pc=0x46d4ee
runtime.goparkunlock(...)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:430
runtime.forcegchelper()
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:337 +0xb3 fp=0xc000084fe0 sp=0xc000084fa8 pc=0x4398d3
runtime.goexit({})
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000084fe8 sp=0xc000084fe0 pc=0x4751a1
created by runtime.init.7 in goroutine 1
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:325 +0x1a
goroutine 3 gp=0xc000007180 m=nil [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:424 +0xce fp=0xc000085780 sp=0xc000085760 pc=0x46d4ee
runtime.goparkunlock(...)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:430
runtime.bgsweep(0xc0000ac000)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mgcsweep.go:277 +0x94 fp=0xc0000857c8 sp=0xc000085780 pc=0x4240d4
runtime.gcenable.gowrap1()
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mgc.go:203 +0x25 fp=0xc0000857e0 sp=0xc0000857c8 pc=0x4187e5
runtime.goexit({})
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000857e8 sp=0xc0000857e0 pc=0x4751a1
created by runtime.gcenable in goroutine 1
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mgc.go:203 +0x66
goroutine 4 gp=0xc000007340 m=nil [GC scavenge wait]:
runtime.gopark(0xc0000ac000?, 0x1612280?, 0x1?, 0x0?, 0xc000007340?)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:424 +0xce fp=0xc000085f78 sp=0xc000085f58 pc=0x46d4ee
runtime.goparkunlock(...)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:430
runtime.(*scavengerState).park(0x1e61780)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mgcscavenge.go:425 +0x49 fp=0xc000085fa8 sp=0xc000085f78 pc=0x421ae9
runtime.bgscavenge(0xc0000ac000)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mgcscavenge.go:653 +0x3c fp=0xc000085fc8 sp=0xc000085fa8 pc=0x42205c
runtime.gcenable.gowrap2()
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mgc.go:204 +0x25 fp=0xc000085fe0 sp=0xc000085fc8 pc=0x418785
runtime.goexit({})
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000085fe8 sp=0xc000085fe0 pc=0x4751a1
created by runtime.gcenable in goroutine 1
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mgc.go:204 +0xa5
goroutine 5 gp=0xc000007c00 m=nil [finalizer wait]:
runtime.gopark(0xc000084648?, 0x40ed25?, 0xb0?, 0x1?, 0xc0000061c0?)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:424 +0xce fp=0xc000084620 sp=0xc000084600 pc=0x46d4ee
runtime.runfinq()
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mfinal.go:193 +0x107 fp=0xc0000847e0 sp=0xc000084620 pc=0x417867
runtime.goexit({})
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000847e8 sp=0xc0000847e0 pc=0x4751a1
created by runtime.createfing in goroutine 1
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mfinal.go:163 +0x3d
goroutine 6 gp=0xc0002cec40 m=nil [chan receive]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:424 +0xce fp=0xc000086718 sp=0xc0000866f8 pc=0x46d4ee
runtime.chanrecv(0xc0000bc7e0, 0x0, 0x1)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/chan.go:639 +0x41c fp=0xc000086790 sp=0xc000086718 pc=0x4084fc
runtime.chanrecv1(0x0?, 0x0?)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/chan.go:489 +0x12 fp=0xc0000867b8 sp=0xc000086790 pc=0x4080b2
runtime.unique_runtime_registerUniqueMapCleanup.func1(...)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mgc.go:1732
runtime.unique_runtime_registerUniqueMapCleanup.gowrap1()
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mgc.go:1735 +0x2f fp=0xc0000867e0 sp=0xc0000867b8 pc=0x41b7ef
runtime.goexit({})
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000867e8 sp=0xc0000867e0 pc=0x4751a1
created by unique.runtime_registerUniqueMapCleanup in goroutine 1
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/mgc.go:1730 +0x96
goroutine 7 gp=0xc0002cefc0 m=nil [select, locked to thread]:
runtime.gopark(0xc000086fa8?, 0x2?, 0xa8?, 0x6e?, 0xc000086f94?)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/proc.go:424 +0xce fp=0xc000086e30 sp=0xc000086e10 pc=0x46d4ee
runtime.selectgo(0xc000086fa8, 0xc000086f90, 0x0?, 0x0, 0x0?, 0x1)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/select.go:335 +0x7a5 fp=0xc000086f58 sp=0xc000086e30 pc=0x44b245
runtime.ensureSigM.func1()
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/signal_unix.go:1060 +0x19f fp=0xc000086fe0 sp=0xc000086f58 pc=0x4651bf
runtime.goexit({})
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000086fe8 sp=0xc000086fe0 pc=0x4751a1
created by runtime.ensureSigM in goroutine 1
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/signal_unix.go:1043 +0xc8
goroutine 18 gp=0xc000484380 m=3 mp=0xc00007ce08 [syscall]:
runtime.notetsleepg(0x1e942e0, 0xffffffffffffffff)
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/lock_futex.go:246 +0x29 fp=0xc0000807a0 sp=0xc000080778 pc=0x40dc49
os/signal.signal_recv()
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/sigqueue.go:152 +0x29 fp=0xc0000807c0 sp=0xc0000807a0 pc=0x46f209
os/signal.loop()
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/os/signal/signal_unix.go:23 +0x13 fp=0xc0000807e0 sp=0xc0000807c0 pc=0x520f93
runtime.goexit({})
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000807e8 sp=0xc0000807e0 pc=0x4751a1
created by os/signal.Notify.func1.1 in goroutine 1
/home/misaki/.version-fox/temp/1727625600-172028/golang/src/os/signal/signal.go:151 +0x1f
exit status 2
The go version I use is 1.23 ╭─[HN400046] as misaki in ~/dev/dice using Golang 1.23.0 on (master)✘✘✘ 09:56:41
╰─(ノ˚Д˚)ノ go version
go version go1.23.0 linux/amd64
╭─[HN400046] as misaki in ~/dev/dice using Golang 1.23.0 on (master)✘✘✘ 09:59:19
╰─(ノ˚Д˚)ノ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
╭─[HN400046] as misaki in ~/dev/dice using Golang 1.23.0 on (master)✘✘✘ 09:59:57
╰─(ノ˚Д˚)ノ uname -r
5.15.153.1-microsoft-standard-WSL2
╭─[HN400046] as misaki in ~/dev/dice using Golang 1.23.0 on (master)✘✘✘ 10:00:06
╰─(ノ˚Д˚)ノ free -h
total used free shared buff/cache available
Mem: 7.6Gi 744Mi 6.1Gi 3.0Mi 786Mi 6.6Gi
Swap: 2.0Gi 0B 2.0Gi
Can someone help me solve this problem? |
Beta Was this translation helpful? Give feedback.
Answered by
Misaki030112
Oct 8, 2024
Replies: 1 comment 1 reply
-
i am also facing the same issue. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#908
I found this issue and its associated PR that solved the problem I was having for the first time.
in fact,
If the KeysLimit value is not configured in this code, the default value is 200 million, which results in the channel requiring at least 9.6GB of memory.
Key(16bytes)+Operation(16bytes)+Value(16bytes)=48bytes
48bytes×200,000,000=9,600,000,000bytes=9.6GB
My memory is 8GB, and the available memory is less than 8G all year round, which will cause OOM.