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
evm leaks memory doing 256-bit arithmetic #14497
Comments
Well it does contain an infinite loop and unfortunately 256bit arithmetic -- or rather Go's big num package -- more or less requires newly allocated objects for each operation; and by default the Try running with |
I'd expect the problem to be due to the intpool - it's not limited, is it ? |
No it isn't limited, but that doesn't matter. It wouldn't be "limited" without the pool either, i.e. it would have to allocate a new |
It still uses more memory until it runs out of gas. A leak in my book - the collector should recover the memory. I'm using long loops in my tests to get stable timings that overwhelm the startup costs. |
The problem is the Maybe I'm not understanding the problem, does it, or does it not go oog? |
I have a 16 GB machine , and Sierra killed it when the memory image hit 62 GB. |
Sorry, my bad it does run metered. I was under the impression we were running unmetered which was causing your issues. I'll look in to this. |
Thanks. |
Here's what happens, a snippet of execution:
The ops are skewed, they instantiate bigints and put them on the pool for reuse - but there are not enough reuse going on within these particular ops in the loop. These ops specifically:
So we should limit the intpool. Each loop adds 3 elements. |
This issue has been resolved in #14336 |
Giving the program 1E9 units of gas, and running on Xubuntu on an old Dell, I now get these numbers from top and time.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
System information
evm version 1.6.1-stable-021c3c28
solc, the solidity compiler commandline interface
Version: 0.4.11-develop.2017.5.3+commit.34b28ed7.Darwin.appleclang
macOS 10.12.4
Expected behaviour
Program should run with stable memory usage until gas is exhausted.
Actual behaviour
Program leaks, using more memory the longer it runs, until system is thrashing.
Other programs with other operators do the same, making it impossible to benchmark them.
Steps to reproduce the behaviour
Compile appended code and run it with evm.
The text was updated successfully, but these errors were encountered: