Getting bad_alloc errors from erlexec

When checking log/epoch_pow_cuckoo.log I see a lot of aec_pow_cuckoo:wait_for_result:375 ERROR: terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc errors from erlexec.

What could be the reason?

2018-12-01 16:28:18.335 [error] <0.14016.0>@aec_pow_cuckoo:wait_for_result:390 OS process died: {status,134}
2018-12-01 16:28:18.345 [debug] <0.14018.0>@aec_pow_cuckoo:generate:78 Generating solution for data hash <<241,47,147,159,241,182,27,98,61,243,26,53,0,2,237,3,155,180,151,76,97,216,151,84,55,17,41,97,186,33,103,57>> and nonce 10784863759043545660 with target 520669531.
2018-12-01 16:28:18.345 [info] <0.14018.0>@aec_pow_cuckoo:generate_int:183 Executing cmd: "./mean29-generic -h 8S+Tn/G2G2I98xo1AALtA5u0l0xh2JdUNxEpYbohZzk=PErGvHKIq5U= -t 1"
2018-12-01 16:28:18.351 [error] <0.14018.0>@aec_pow_cuckoo:wait_for_result:375 ERROR: terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

2018-12-01 16:28:18.611 [error] <0.14018.0>@aec_pow_cuckoo:wait_for_result:375 ERROR: Aborted (core dumped)

2018-12-01 16:28:18.615 [error] <0.14018.0>@aec_pow_cuckoo:wait_for_result:390 OS process died: {status,134}
2018-12-01 16:28:18.626 [debug] <0.14020.0>@aec_pow_cuckoo:generate:78 Generating solution for data hash <<241,47,147,159,241,182,27,98,61,243,26,53,0,2,237,3,155,180,151,76,97,216,151,84,55,17,41,97,186,33,103,57>> and nonce 10784863759043545661 with target 520669531.
2018-12-01 16:28:18.626 [info] <0.14020.0>@aec_pow_cuckoo:generate_int:183 Executing cmd: "./mean29-generic -h 8S+Tn/G2G2I98xo1AALtA5u0l0xh2JdUNxEpYbohZzk=PUrGvHKIq5U= -t 1"
2018-12-01 16:28:18.632 [error] <0.14020.0>@aec_pow_cuckoo:wait_for_result:375 ERROR: terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Just for note, I’ve downloaded the release from github and running it on ubuntu 18.04.

Am I running out of memory? htop shows that I’m not using even half of the available memory.

Are you using mean? and what miner executable are you using?

Hi @Kryztoval

Yes, I was using the default (mean29-generic). I’ve tried using a bigger server, and it seems to be working fine now …

there are two miner modes, lean and mean, mean requires 4gb
lean one uses about 200mb. if you have cosntrained memory you should use lean.

I had 4GB RAM on the previous server. On the new one I have 32GB RAM, and only 3.45GB is being used …

it peaks, because the start time it creates a full cuckoo three that requires 4gb then it gets trimmed. but if it fills then it wont run.

So 32GB of RAM is too unnecessary?

yeah, 5gb should be fine for 1 cpu mean miner instance.

So each CPU needs ~5GB? I’m using -t 7 option right now for the mean29-generic, so I guess I’m using 7 CPUs, does that mean that my memory consumption should be 35GB?

No, each miner instance needs about 4.2Gb, and you can tell a miner to use several threads. I think each thread adds a bit of memory but not too much.

If your cpu supports avx2 use it, it is faster. :slight_smile:

If your cpu supports avx2 use it, it is faster. :slight_smile:

Tried it, didn’t work :frowning:

Normally Avx2 is not virtualizable, if you are running inside a vm it won’t work.

I’m just trying out scaleway, they claim to be running on baremetal. But that’s probably not relevant.

Anyway, thank you for the help!

It shiould be enabled if it is available to the kernel.