aerospike / aerospike-client-go

Aerospike Client Go
Apache License 2.0
430 stars 199 forks source link

Difference size of allocated memory between client v4.5 and v6.9.1 #397

Closed kennykarnama closed 1 year ago

kennykarnama commented 1 year ago

Hi, I tried to do pprof in my go apps.

I noticed there is difference in size of memory allocation when I use client v4.5 and v6.9.1. IN v6.9.1, the total memory allocated is much better.

Do you have any ideas what has been changed between v4.5 and v6.9.1?

Both use same parameters.

clientPolicy := as.NewClientPolicy()
clientPolicy.ConnectionQueueSize = 512
clientPolicy.LimitConnectionsToQueueSize = true
clientPolicy.Timeout = 5 * time.Second
clientPolicy.MinConnectionsPerNode = 5

Here is the profiling heap result.

v4.5

out2_2

v6.9.1

out3_3

kennykarnama commented 1 year ago

We are considering upgrading for v6. Just needs some justifications regarding this 😄

khaf commented 1 year ago

A lot of optimizations went into the v5 (which was the big update), but unfortunately, although I took a cursory glance at the change log, I could not come up with something that would be the sole improvement. Many things, including default values of various pools and buffers could influence this.

kennykarnama commented 1 year ago

I see. Thank you