Closed
Description
Consider the following code:
package main
import r "gopkg.in/rethinkdb/rethinkdb-go.v5"
func main() {
session, err := r.Connect(r.ConnectOpts{Address: "localhost:28015"})
if err != nil {
return
}
execOpts := r.ExecOpts{NoReply: true}
insertOpts := r.InsertOpts{Conflict: "update"}
t := r.DB("test_db").Table("test_table")
for {
err = t.Insert(r.JSON(`{"id":"xxx", "a": 1}`), insertOpts).Exec(session, execOpts)
if err != nil {
return
}
}
}
when running this for around 1-2 minutes memory usage reaches 15GB
when using .Run
instead of .Exec
memory usage stays at ~10MB
Is there a memory leak here or I'm doing something wrong ?
Metadata
Metadata
Assignees
Labels
No labels