Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug blockchain reference test 455 #1398

Draft
wants to merge 1 commit into
base: arith-dev
Choose a base branch
from

Conversation

gauravahuja
Copy link
Contributor

@gauravahuja gauravahuja commented Oct 9, 2024

Steps to reproduce the OOM error:

  1. Checkout this branch
  2. ./gradlew generateBlockchainReferenceTests
  3. In BlockchainReferenceTest_455.java set private static final String[] TEST_CONFIG_FILE_DIR_PATH = { "BlockchainTests/GeneralStateTests/stTimeConsuming/static_Call50000_sha256.json" };
  4. Run BlockchainReferenceTest_455 in the IDE or in terminal ./gradlew reference-tests:referenceBlockchainTests --tests "BlockchainReferenceTest_455"

The test case static_Call50000_sha256_* in BlockchainReferenceTest_455 causes the JVM to run out of heap space. Increasing the heap to 24G worked for me.

In this test ZkTracer.traceContextEnter is invoked 50000 times (Don't know why), and inside this method this.hub.traceContextEnter(frame) consumes up all the heap.

@ahamlat
Copy link
Contributor

ahamlat commented Oct 17, 2024

Most of the objects in memory are related to the MMU module, which is coherent with SHA256 test, but I see also that Optional takes non negligible amount of memory (almost 5 GiB), and we should get rid of them.
Here are some fields that we need change and remove Optional (From the heap dump)

In MmuCall.java

  private Optional<Bytes> sourceRamBytes = Optional.empty();
  private Optional<Bytes> targetRamBytes = Optional.empty();
  private Optional<Bytes> exoBytes = Optional.empty();

In CallSection.java

  public Optional<Address> precompileAddress;

in AccountFragment.java

  private final Optional<Bytes> addressToTrim;
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants