nxadm/ldifdiff

Out of memory issue

narulavaibhav opened this issue · 2 comments

When comparing files like 800 MB in design the program dies

fatal error: runtime: out of memory

runtime stack:
runtime.throw(0x50fd00, 0x16)
/usr/local/go/src/runtime/panic.go:605 +0x95
runtime.sysMap(0xc5a88e0000, 0x5b9c0000, 0x0, 0x5c11f8)
/usr/local/go/src/runtime/mem_linux.go:216 +0x1d0
runtime.(*mheap).sysAlloc(0x5a8be0, 0x5b9c0000, 0x7f6d68b59ab8)
/usr/local/go/src/runtime/malloc.go:470 +0xd7
runtime.(*mheap).grow(0x5a8be0, 0x2dcda, 0x0)
/usr/local/go/src/runtime/mheap.go:887 +0x60
runtime.(*mheap).allocSpanLocked(0x5a8be0, 0x2dcda, 0x5c1208, 0x7f6d621c9710)
/usr/local/go/src/runtime/mheap.go:800 +0x334
runtime.(*mheap).alloc_m(0x5a8be0, 0x2dcda, 0xc420060101, 0x413a9c)
/usr/local/go/src/runtime/mheap.go:666 +0x118
runtime.(*mheap).alloc.func1()
/usr/local/go/src/runtime/mheap.go:733 +0x4d
runtime.systemstack(0xc42006df08)
/usr/local/go/src/runtime/asm_amd64.s:360 +0xab
runtime.(*mheap).alloc(0x5a8be0, 0x2dcda, 0xc420010101, 0xc42006df01)
/usr/local/go/src/runtime/mheap.go:732 +0xa1
runtime.largeAlloc(0x5b9b2a22, 0xc420000101, 0x4)
/usr/local/go/src/runtime/malloc.go:827 +0x98
runtime.mallocgc.func1()
/usr/local/go/src/runtime/malloc.go:722 +0x46
runtime.systemstack(0xc420020600)
/usr/local/go/src/runtime/asm_amd64.s:344 +0x79
runtime.mstart()
/usr/local/go/src/runtime/proc.go:1125

goroutine 34 [running]:
runtime.systemstack_switch()
/usr/local/go/src/runtime/asm_amd64.s:298 fp=0xc420288ca8 sp=0xc420288ca0 pc=0x44fc40
runtime.mallocgc(0x5b9b2a22, 0x4e5da0, 0xc420288d01, 0x43f768)
/usr/local/go/src/runtime/malloc.go:721 +0x7b8 fp=0xc420288d50 sp=0xc420288ca8 pc=0x40f8e8
runtime.makeslice(0x4e5da0, 0x5b9b2a22, 0x5b9b2a22, 0x2a, 0x2a, 0x1)
/usr/local/go/src/runtime/slice.go:54 +0x77 fp=0xc420288d80 sp=0xc420288d50 pc=0x43c067
bytes.makeSlice(0x5b9b2a22, 0x0, 0x0, 0x0)
/usr/local/go/src/bytes/buffer.go:231 +0x77 fp=0xc420288dc0 sp=0xc420288d80 pc=0x49cb37
bytes.(*Buffer).grow(0xc4fb1f2000, 0x2a, 0xc4f5f3cff0)
/usr/local/go/src/bytes/buffer.go:133 +0x141 fp=0xc420288e18 sp=0xc420288dc0 pc=0x49c731
bytes.(*Buffer).WriteString(0xc4fb1f2000, 0xc4f5f3cff0, 0x2a, 0x50ccab, 0x1, 0xc4f5f3cff0)
/usr/local/go/src/bytes/buffer.go:175 +0xdd fp=0xc420288e48 sp=0xc420288e18 pc=0x49ca7d
github.com/nxadm/ldifdiff.writeLdif(0xc4200ec720, 0xc4fb1f2000, 0xc4fb1ec450, 0xc4fb086730)
/usr/local/go/dev/src/github.com/nxadm/ldifdiff/ldifConvertor.go:49 +0x55f fp=0xc420288fc0 sp=0xc420288e48 pc=0x4d0caf
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc420288fc8 sp=0xc420288fc0 pc=0x4527c1
created by github.com/nxadm/ldifdiff.compare
/usr/local/go/dev/src/github.com/nxadm/ldifdiff/diff.go:112 +0x15f

nxadm commented

Thank you for the report. I'll look into it. The files I worked with are around 500 mb. How much RAM does the machine/vm/container has where the out of memory occurs?

nxadm commented

Close because of lack of feedback. Feel free to reopen it.