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

code parameters do not give correct memory usage #2

Open
lowagner opened this issue Apr 29, 2017 · 3 comments
Open

code parameters do not give correct memory usage #2

lowagner opened this issue Apr 29, 2017 · 3 comments

Comments

@lowagner
Copy link

from the paper, n=144, k=5, should require 704 MB of memory, but the code does something terrifying on my linux box here. it says it will take 1.56GB, and then goes on to take somewhere between 5 and 6 GB of memory. also, due to how memory is handled/requested, this crashes my other computer (with only 8GB of memory, maybe it's running out of swap):

./equihash -n 144 -k 5 -s 1234 & while true; do free -m; sleep 1; done
N:	144 
K:	5 
SEED:  	1234  	1234  	1234  	1234 
Memory:		1638400KiB
Testing nonce 2
              total        used        free      shared  buff/cache   available
Mem:          15970        2660       10793         611        2517       12327
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        3341       10111         611        2517       11646
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        4028        9424         611        2517       10959
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        4723        8730         611        2517       10264
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        5409        8043         611        2517        9578
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        6118        7335         611        2517        8869
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        6845        6607         611        2517        8141
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        7577        5875         611        2517        7410
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        8311        5142         611        2517        6676
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        8496        4957         611        2517        6491
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        8496        4957         611        2517        6491
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        8495        4957         611        2517        6492
Swap:          4095           3        4092
@lowagner
Copy link
Author

oh, and it gets even worse if i let it go to the next iteration, so we must not be keeping track of memory very well:

              total        used        free      shared  buff/cache   available
Mem:          15970        8620        4832         608        2517        6369
Swap:          4095           3        4092
Filling 86367.62  Mcycles 
              total        used        free      shared  buff/cache   available
Mem:          15970        8847        4605         608        2517        6142
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        9443        4009         608        2517        5546
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970        9959        3493         608        2517        5030
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970       10497        2954         608        2517        4492
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970       11101        2351         608        2517        3889
Swap:          4095           3        4092
              total        used        free      shared  buff/cache   available
Mem:          15970       11790        1662         608        2517        3199
Swap:          4095           3        4092

@khovratovich
Copy link
Owner

This reference implementation is not optimized for memory at all. For the most efficient version please refer to https://github.com/xenoncat/equihash-xenon

@lowagner
Copy link
Author

ok, thanks!

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

No branches or pull requests

2 participants