We noticed this as using JSONWire/TextWire and calling clear() calls valueOut.resetState(); which has sep = empty(); and we started seeing those calls generating garbage.
Would it be possible to change empty to not allocate or is there another recommended way to reset the state of a wire so it can be reused which does not allocate?
It looks like
BytesStore.empty()
started allocating with this change: https://github.com/OpenHFT/Chronicle-Bytes/pull/407.We noticed this as using JSONWire/TextWire and calling
clear()
callsvalueOut.resetState();
which hassep = empty();
and we started seeing those calls generating garbage.Would it be possible to change
empty
to not allocate or is there another recommended way to reset the state of a wire so it can be reused which does not allocate?