Writing a block for each domain fixes the memory issue.