issue #86
in MockProver fork method, there are some fields' clone operation happens in following code snippets.
among them self.cs.clone() and self.instance.clone() increase about 90M memory costs each time.
in very complex test tool tests(like create2_recursive_xxx) , there are > 4000 regions being generated and result in more than 4000 times clone operations. this increase the peak memory remarkably. for normal test, there are only about 100 sub regions used, so no much memory going up.
fix solution:
change both self.cs and self.instance to Arc type, after testing against latest zkevm develop branch(disabled batch_inv feature) peak memory size down to less than 100G while old test run take >300 G
issue #86 in MockProver
fork
method, there are some fields' clone operation happens in following code snippets.among them
self.cs.clone()
andself.instance.clone()
increase about 90M memory costs each time.in very complex test tool tests(like
create2_recursive_xxx
) , there are > 4000 regions being generated and result in more than 4000 times clone operations. this increase the peak memory remarkably. for normal test, there are only about 100 sub regions used, so no much memory going up.fix solution:
change both
self.cs
andself.instance
toArc
type, after testing against latest zkevm develop branch(disabled batch_inv feature) peak memory size down to less than 100G while old test run take >300 G[2024-03-13T02:16:08Z DEBUG halo2_proofs::dev] memory usage of mockprover fork_4107 ends vm_size 81 GB : vm_rss: 68GB