make calculating retained size optional