You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
Not sure this is a bug or by design, I didn't find anything on the docs mention that and I think it made my app OOM
This is the implementation of arena pool:
// Get returns an Arena from ap.//// The Arena must be Put to ap after use.func (ap*ArenaPool) Get() *Arena {
v:=ap.pool.Get()
ifv==nil {
return&Arena{}
}
returnv.(*Arena)
}
// Put returns a to ap.//// a and objects created by a cannot be used after a is put into ap.func (ap*ArenaPool) Put(a*Arena) {
ap.pool.Put(a)
}
However (AFAIK), pools usually should call reset on returned object
so shouldn't Put implementation should be:
a.Reset()
ap.pool.Put(a)
I can call .Reset myself but since the pool is not doing that, I'm afraid that I might be missing something?
Would really appreciate if you have time to look,
Thanks!
The text was updated successfully, but these errors were encountered:
Hey,
Not sure this is a bug or by design, I didn't find anything on the docs mention that and I think it made my app OOM
This is the implementation of arena pool:
However (AFAIK), pools usually should call reset on returned object
so shouldn't Put implementation should be:
I can call
.Reset
myself but since the pool is not doing that, I'm afraid that I might be missing something?Would really appreciate if you have time to look,
Thanks!
The text was updated successfully, but these errors were encountered: