Track stack changes to determine max stack size.