Remove use of deque() in transaction to reduce memory fragmentation.