fastjson
                                
                                 fastjson copied to clipboard
                                
                                    fastjson copied to clipboard
                            
                            
                            
                        Shouldn't ArenaPool call arena.Reset() on Put or on Get?
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()
	if v == nil {
		return &Arena{}
	}
	return v.(*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!
Same question.
Same here... I see that the 'b' field is keep growing if I'm not using Reset()