-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
Reproduce: run a memory profiler with the following test case
func Test_ChunkedResponse_Leak(t *testing.T) {
genValues := func(n int) [][]interface{} {
var values [][]interface{}
for i := 0; i < n; i++ {
values = append(values, []interface{}{
json.Number("1716134400628000000"),
json.Number("35000.01"),
json.Number("8"),
})
}
return values
}
for i := 0; i < 100000; i++ {
resp := influx.NewChunkedResponse(bytesReader(toJson(&influx.Response{
Results: []influx.Result{
{
Series: []models.Row{
{
Columns: []string{"time", "last", "price_precision"},
Values: genValues(3000),
},
},
},
},
})))
_, err2 := resp.NextResponse()
assert.NoError(t, err2)
err := resp.Close()
assert.NoError(t, err)
}
}
Flame Graph:

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels