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

[BUG] sozo test high RAM usage (20GB+) #2314

Open
rsodre opened this issue Aug 18, 2024 · 5 comments
Open

[BUG] sozo test high RAM usage (20GB+) #2314

rsodre opened this issue Aug 18, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@rsodre
Copy link

rsodre commented Aug 18, 2024

Describe the bug
Running any simple tet on pistols consumes 18-20GB of RAM

To Reproduce

  • clone pistols
  • cd dojo
  • sozo test -f test_initialize_table (any test will demonstrate there problem, this is a very simple one)
  • open Activity Monitor on macOS or a similar status monitor
  • go to the Memory tab and filter by sozo
  • while sozo builds, used memory goes up to 9GB, when it starts to run tests, it doubles and stays ~17-20GB

and please notice this gas consumption on simple tests (test_initialize_table_defaults)...

$ sozo test -f test_initialize_table
testing test(pistols_unittest) pistols v0.10.0-3 (/Users/roger/Dev/Realms/pistols/dojo/Scarb.toml)
running 2 tests
test pistols::tests::test_admin::tests::test_initialize_table ... ok (gas usage est.: 52,242,666)
test pistols::tests::test_admin::tests::test_initialize_table_defaults ... ok (gas usage est.: 54,464,862)
test result: ok. 2 passed; 0 failed; 0 ignored; 233 filtered out;

Expected behaviour
A clear and concise description of what you expected to happen.

Screenshots
Screenshot 2024-08-18 at 10 38 16

Additional context

  • using Dojo 1.0.0-alpha.6 + Scarb 2.7
  • The project uses the origami_token package ERC-20 and ERC-721, and some openzeppelin utils.
  • Note that I have to include openzeppelin_test_common to be able to run tests, even if not using any openzeppelin in the tests
@rsodre rsodre added the bug Something isn't working label Aug 18, 2024
@lambda-0x
Copy link
Collaborator

lambda-0x commented Aug 21, 2024

just to add some quick context, i checked the memory usage on spawn-and-move example that is in the repo and memory usage was around 1.2GB for build and 3.5GB for running the test (it only has couple of tests).

and since sozo build and sozo test are light wrapper around scarb i dont think the issue is specially related to sozo, i will do a memory profile to confirm this.

@rsodre
Copy link
Author

rsodre commented Aug 21, 2024

origami token package: ~4GB during build, ~8.5GB during tests

sozo test --package origami_token

@ShantelPeters
Copy link

@rsodre please can I be assigned

@rsodre rsodre changed the title [BUG] sozo test memory consumption [BUG] sozo test high RAM usage (20GB+) Aug 26, 2024
@glihm
Copy link
Collaborator

glihm commented Aug 29, 2024

For the record, scarb has also notice significative increment of the compilation time. We may depend on what their bottleneck is.

@ShantelPeters do you have an idea of what could be dojo bottleneck related to compilation? Happy to assign if you have some suggestions.

@rsodre
Copy link
Author

rsodre commented Aug 31, 2024

Is there an scarb issue for that?

The language server is also consumes around 6GB.

Btw, running the same test with Dojo alpha 9, it's around 13GB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants