use a counter to track how often we need to allocate a new []byte