Calculate one instance usage per transaction.

This prevent increasing the memory usage due to huge workflow history.