-
Notifications
You must be signed in to change notification settings - Fork 61
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
Memory exhaustion #272
Comments
I reproduced it with starknet.js tests and I can confirm that behavior, after 3 test runs starknet-devnet-rs takes 22gb of memory but it shouldn't. @ivpavici suggested checking if it's not accidentally downloading Netflix movies in the background. |
@mikiw I think you might be after something with that last idea: |
While minding my own business, I was digging through the code and had some ideas about this issue.
|
@sgc-code hey, do you need old state history? Like, being able to query old states with an old block_id? |
Hi, @FabijanC if we have a flag to disable old history it could workaround our issue for now. We don't currently need to access the older blocks. Maybe you want to look into some more efficient storage options later. Thanks |
@sgc-code Sure we are also considering more efficient storage options, but were just considering conditional disabling of state storing as the quickest fix. Thanks for the reply |
So the flag is added here #290 but I'm still not sure if the current code is right for the flag set to |
I suspect the largest part of the state history are contract classes. As has already been mentioned somewhere, storing a clone of state (together with declared classes) for each block is highly inefficient. That's why we are currently defaulting to not storing the state history. ProposalInstead of cloning all of the classes, we could have one global storage of type WhySo cloning a state would only clone the reference ( Implementation detailsWhen retrieving a class (in the response of the JSON-RPC method Refactoring might be needed to store a contract class together with the next block number, because currently we store the class before the next block is created. |
Describe the bug (observed vs expected behavior)
We completed our migration from devnet python to devnet rust, after a few adjustments now we have all tests running again. There is only one issue. Our tests take around 20 min to run, during that time the devnet memory keeps increasing, after 5 minutes it reaches 7.99Gb and it starts to slow down, after another minute the container stops (no specific error i could find)
As a workaround we are calling the
restart
endpoint every 2 minutes, and that seems to help, although i still see the memory increasing it’s good enough for our test suite (edited)Not reproducible on alpha-goerli
To Reproduce
Steps to reproduce the behavior:
Devnet version
System specifications
The text was updated successfully, but these errors were encountered: