Fatal error: runtime: out of memory

Influxdb is going down every 5 minutes due to this error.

What is the problem here and how it can be solved ?

It displays this error in the logs, and then a stacktrace is given.
This is the stacktrace below,

runtime stack:
runtime.throw(0xac3afa, 0x16) /usr/local/go/src/runtime/panic.go:566 +0x95
runtime.sysMap(0xc44e8a0000, 0x100000, 0x455600, 0xe7b938) /usr/local/go/src/runtime/mem_linux.go:219 +0x1d0
runtime.(*mheap).sysAlloc(0xe623a0, 0x100000, 0xc0000ba278) /usr/local/go/src/runtime/malloc.go:407 +0x37a
runtime.(*mheap).grow(0xe623a0, 0x1, 0x0) /usr/local/go/src/runtime/mheap.go:726 +0x62runtime.(*mheap).allocSpanLocked(0xe623a0, 0x1, 0x75)
/usr/local/go/src/runtime/mheap.go:630 +0x4f2runtime.(*mheap).alloc_m(0xe623a0, 0x1, 0x10, 0xc44e895d5d)
/usr/local/go/src/runtime/mheap.go:515 +0xe0runtime.(*mheap).alloc.func1()
/usr/local/go/src/runtime/mheap.go:579 +0x4bruntime.systemstack(0x7f6b078e1d48)
/usr/local/go/src/runtime/asm_amd64.s:314 +0xabruntime.(*mheap).alloc(0xe623a0, 0x1, 0x10000000010, 0x410b79)
/usr/local/go/src/runtime/mheap.go:580 +0x73runtime.(*mcentral).grow(0xe63d70, 0x0)
/usr/local/go/src/runtime/mcentral.go:210 +0x94runtime.(*mcentral).cacheSpan(0xe63d70, 0xc420015228)
/usr/local/go/src/runtime/mcentral.go:91 +0xfaruntime.(*mcache).refill(0x7f6b2c9e1000, 0xc400000010, 0xc43a837940)
/usr/local/go/src/runtime/mcache.go:121 +0xaeruntime.(*mcache).nextFree.func1()
/usr/local/go/src/runtime/malloc.go:505 +0x33runtime.systemstack(0xc420014000)
/usr/local/go/src/runtime/asm_amd64.s:298 +0x79runtime.mstart()
/usr/local/go/src/runtime/proc.go:1079`

And below are many other go routines which I cannot paste here as they are too large.

@Luv This means that the database is using too much memory. This is likely due to the series count. You will need to reduce the number of series in the database.