sleepinggenius2/gosmi

I am getting out of memory while parsing the Mib and the error is as follows,runtime: VirtualAlloc of 173408256 bytes failed with errno=1455

Opened this issue · 0 comments

hi ,
I am getting out of memory while parsing the Mib and the error is as follows

INSPUR_EXT_MIB_1.0.0.zip

         gosmi.Init()
	gosmi.AppendPath("E:\\dev\\go\\gosmi-0.4.4\\mibs")
	module, _ := gosmi.LoadModule("INSPUR_EXT_MIB_1.0.0.MIB")
	m, _ := gosmi.GetModule(module)
	trapNodes := m.GetNodes()
	for _, node := range trapNodes {
	     fmt.Println(fmt.Sprintf("Trap %s::%s [%s]\n%+v\n", module, node.Name, node.Oid, node.GetRaw()))
          }

runtime: VirtualAlloc of 173408256 bytes failed with errno=1455
fatal error: out of memory

runtime stack:
runtime.throw(0x3e8505, 0xd)
D:/Go/src/runtime/panic.go:1117 +0x79
runtime.sysUsed(0xc01ea58000, 0xa560000)
D:/Go/src/runtime/mem_windows.go:83 +0x22e
runtime.(*mheap).allocSpan(0x4e1d40, 0x52b0, 0x0, 0x1d14fdcc5c8)
D:/Go/src/runtime/mheap.go:1271 +0x3b1
runtime.(*mheap).alloc.func1()
D:/Go/src/runtime/mheap.go:910 +0x5f
runtime.systemstack(0x0)
D:/Go/src/runtime/asm_amd64.s:379 +0x6b
runtime.mstart()
D:/Go/src/runtime/proc.go:1246

goroutine 1 [running]:
runtime.systemstack_switch()
D:/Go/src/runtime/asm_amd64.s:339 fp=0xc0005119f8 sp=0xc0005119f0 pc=0x2e5c40
runtime.(*mheap).alloc(0x4e1d40, 0x52b0, 0x100, 0xc000511a98)
D:/Go/src/runtime/mheap.go:904 +0x88 fp=0xc000511a48 sp=0xc0005119f8 pc=0x2a7648
runtime.(*mcache).allocLarge(0x1d128a20598, 0xa560000, 0xc000120001, 0x2)
D:/Go/src/runtime/mcache.go:224 +0x9e fp=0xc000511aa0 sp=0xc000511a48 pc=0x2978fe
runtime.mallocgc(0xa560000, 0x3dec20, 0x1, 0xc00000cc60)
D:/Go/src/runtime/malloc.go:1078 +0x965 fp=0xc000511b28 sp=0xc000511aa0 pc=0x28e0c5
runtime.growslice(0x3dec20, 0xc01660c000, 0x11a3bb, 0x11a3bb, 0x11a3bc, 0x2, 0xc00035f2b0, 0xe)
D:/Go/src/runtime/slice.go:230 +0x209 fp=0xc000511b90 sp=0xc000511b28 pc=0x2ca9a9
github.com/sleepinggenius2/gosmi.SmiModule.GetNodes(0x0, 0x0, 0x0, 0x0, 0x1, 0xc0001c5ec0, 0xe, 0x0, 0x0, 0xc000016c80, ...)
E:/dev/go/gosmi-0.4.4/module.go:45 +0x20b fp=0xc0
00511cc0 sp=0xc000511b90 pc=0x3a32ab
main.main()
E:/dev/go/gosmi-0.4.4/cmd/test/main.go:25 +0x246 fp=0xc000511f88 sp=0xc000511cc0 pc=0x3a4606
runtime.main()
D:/Go/src/runtime/proc.go:225 +0x256 fp=0xc000511fe0 sp=0xc000511f88 pc=0x2b9ff6
runtime.goexit()
D:/Go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc000511fe8 sp=0xc000511fe0 pc=0x2e7ae1