What version of Go are you using (go version
)?
$ go version 1.16.0
What operating system are you using?
Linux. It is happening inside docker image: gcr.io \ distroless \ static@sha256:c6d5981545ce1406d33e61434c61e9452dad93ecd8397c41e89036ef977a88f4
What version of ristretto are you using?
v3.2011.1
Does this issue reproduce with the latest master?
v3.2011.1 is the latest stable version.
Steps to Reproduce the issue
Run the application and wait until it is killed as Out of memory.
What ristretto options were set?
Default options. Only path and log level are set.
What did you do?
My application is running a stream operation regularly that scans iterates values and my application is killed due to memory after some period. I checked pprof output:
(pprof) top
Showing nodes accounting for 531.20MB, 99.08% of 536.13MB total
Dropped 19 nodes (cum <= 2.68MB)
Showing top 10 nodes out of 18
flat flat% sum% cum cum%
448MB 83.56% 83.56% 448MB 83.56% github.com\dgraph-io\ristretto\z.Calloc (inline)
83.20MB 15.52% 99.08% 83.20MB 15.52% github.com\dgraph-io\badger\v3\skl.newArena (inline)
0 0% 99.08% 85MB 15.85% github.com\bgokden\veri\data.(*Data).InitData
0 0% 99.08% 85MB 15.85% github.com\bgokden\veri\data.(*Dataset).CreateIfNotExists
0 0% 99.08% 85MB 15.85% github.com\bgokden\veri\data.(*Dataset).GetOrCreateIfNotExists
0 0% 99.08% 85MB 15.85% github.com\bgokden\veri\node.(*Node).CreateDataIfNotExists
0 0% 99.08% 85MB 15.85% github.com\bgokden\veri\veriservice._VeriService_CreateDataIfNotExists_Handler
0 0% 99.08% 83.20MB 15.52% github.com\dgraph-io\badger\v3.(*DB).newMemTable
0 0% 99.08% 83.20MB 15.52% github.com\dgraph-io\badger\v3.(*DB).openMemTable
0 0% 99.08% 448MB 83.56% github.com\dgraph-io\badger\v3.(*Stream).Orchestrate.func1
Most of the memory is being used by github.com/dgraph-io/ristretto/z.Calloc
I don’t know if there is a way to free it.
What did you expect to see?
This memory is freed after some period.
What did you see instead?
Continuously increasing memory.
Sorry I had to convert all slashes with reverse slash.