Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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