Hello, I discovered that the time.Ticker instance within the BulkIndexer is consuming a bunch of memory in my long running application that creates and closes many instances of the BulkIndexer. See the following screenshots of a pprof heap visualization that I took of the application (forcing a garbage collection run too).
It appears that the time.Ticker instance is Reset within the flush method, thus causing the memory leak. The fix that I have tested and confirmed working is to simply call Stop on the ticker after the flush call since it is valid to have that Reset call within the flush method for other parts of the BulkIndexer.
I would attach another screenshot of pprof, but the time.Ticker doesn't show up in the visualization due to its small memory footprint.
Hello, I discovered that the
time.Ticker
instance within theBulkIndexer
is consuming a bunch of memory in my long running application that creates and closes many instances of theBulkIndexer
. See the following screenshots of a pprof heap visualization that I took of the application (forcing a garbage collection run too).It appears that the
time.Ticker
instance isReset
within theflush
method, thus causing the memory leak. The fix that I have tested and confirmed working is to simply callStop
on the ticker after theflush
call since it is valid to have thatReset
call within theflush
method for other parts of theBulkIndexer
.I would attach another screenshot of pprof, but the
time.Ticker
doesn't show up in the visualization due to its small memory footprint.