The idea would be to call something like ChangesetWorker.clear() when a transaction is rolled back, so as to release memory. See org.hibernate.search.v6poc.entity.orm.impl.PostTransactionWorkQueueSynchronization#afterCompletion