Spike in RSS memory usage shortly before node OOMing and crashing
A user is running version 19.2.0 on a machine with 16 cores, ~30 GB of memory. The user is running CRDB as a single node and is seeing a large spike in memory usage shortly before a fatal error: out of memory appears. The logs specifically show an increase usage of ~12 GB in memory within 10 seconds
I191122 01:31:54.312746 1 util/log/clog.go:1196 [config] binary: CockroachDB CCL v19.2.0 (x86_64-unknown-linux-gnu, built 2019/11/12 05:13:04, go1.12.12)
I191122 01:31:54.312746 1 util/log/clog.go:1196 [config] arguments: [cockroach start-single-node --insecure --cache=.1 --max-sql-memory=.1 --host=localhost --store=/home/ubuntu/cockroach-data]
I191122 01:31:54.313044 1 server/status/recorder.go:599 available memory from cgroups (8.0 EiB) exceeds system memory 30 GiB, using system memory
I191122 01:31:54.313052 1 cli/start.go:1190 CockroachDB CCL v19.2.0 (x86_64-unknown-linux-gnu, built 2019/11/12 05:13:04, go1.12.12)
I191122 01:31:54.414153 1 server/status/recorder.go:599 available memory from cgroups (8.0 EiB) exceeds system memory 30 GiB, using system memory
I191122 01:31:54.414170 1 server/config.go:394 system total memory: 30 GiB
I191122 01:31:54.414201 1 server/config.go:396 server configuration:
max offset 500000000
cache size 3.0 GiB
SQL memory pool size 3.0 GiB
...
I191122 03:16:45.835895 375 server/status/runtime.go:498 [n1] runtime stats: 19 GiB RSS, 256 goroutines, 2.2 GiB/17 GiB/16 GiB GO alloc/idle/total, 1.9 GiB/2.1 GiB CGO alloc/total, 46.2 CGO/sec, 0.5/0.2 %(u/s)time, 0.0 %gc (0x), 25 KiB/25 KiB (r/w)net
I191122 03:16:54.970687 371 gossip/gossip.go:566 [n1] gossip status (ok, 1 node)
gossip client (0/3 cur/max conns)
gossip server (0/3 cur/max conns, infos 0/0 sent/received, bytes 0B/0B sent/received)
I191122 03:16:55.836011 375 server/status/runtime.go:498 [n1] runtime stats: 11 GiB RSS, 256 goroutines, 2.3 GiB/17 GiB/8.5 GiB GO alloc/idle/total, 1.9 GiB/2.1 GiB CGO alloc/total, 287.4 CGO/sec, 1.4/2.1 %(u/s)time, 0.0 %gc (0x), 23 KiB/24 KiB (r/w)net
I191122 03:17:05.836110 375 server/status/runtime.go:498 [n1] runtime stats: 11 GiB RSS, 255 goroutines, 2.3 GiB/17 GiB/8.5 GiB GO alloc/idle/total, 1.9 GiB/2.1 GiB CGO alloc/total, 75.2 CGO/sec, 0.6/0.2 %(u/s)time, 0.0 %gc (0x), 39 KiB/39 KiB (r/w)net
I191122 03:17:15.836188 375 server/status/runtime.go:498 [n1] runtime stats: 11 GiB RSS, 255 goroutines, 2.3 GiB/17 GiB/8.5 GiB GO alloc/idle/total, 1.9 GiB/2.1 GiB CGO alloc/total, 49.6 CGO/sec, 0.6/0.1 %(u/s)time, 0.0 %gc (0x), 25 KiB/25 KiB (r/w)net
I191122 03:17:26.759537 375 server/status/runtime.go:498 [n1] runtime stats: 23 GiB RSS, 739 goroutines, 19 GiB/376 MiB/20 GiB GO alloc/idle/total, 3.0 GiB/3.3 GiB CGO alloc/total, 4410.0 CGO/sec, 179.3/196.5 %(u/s)time, 0.2 %gc (5x), 1.4 MiB/1.7 MiB (r/w)net
fatal error: runtime: out of memory
runtime stack:
runtime.throw(0x404334d, 0x16)
The user has attempted to adjust the cache and max-sql-memory setting without improvement. This typically happens after about a day of the cockroach process running.
A debug zip, along with heap and goroutine profiles can be found here
Zendesk ticket #4126 has been linked to this issue.
Profiles have been attached here. User was asking for a follow up.
Confirmed with @ricardocrdb, closing issue.