Improve accuracy of get/setAllocationCounter