tally icon indicating copy to clipboard operation
tally copied to clipboard

Implementation of ObjectPool can lead to memory leaks

Open andersjohnsen opened this issue 7 years ago • 1 comments

The ObjectPool implementation is used to cache string and array buffers. However, the underlying buffer is never truncated (the full capacity is kept) which means that they over time can built up.

I suggest either using https://golang.org/pkg/sync/#Pool that's GC aware (can be reclaimed by the GC when it sees fit) or explicitly dropping the buffer after X usages.

CC @jstroem

andersjohnsen avatar Dec 05 '17 11:12 andersjohnsen

A similar issue; buffered scopes will never be pruned so if you use different tags for every call the number of buffered scopes will grow and never get droped.

jstroem avatar Dec 05 '17 12:12 jstroem