spesmilo / electrumx

Alternative implementation of spesmilo/electrum-server
MIT License
438 stars 349 forks source link

terminate called after throwing an instance of 'std::bad_alloc' #131

Open fooedge2 opened 3 years ago

fooedge2 commented 3 years ago

I get this kind of error constantly after a few minutes - hour after I start electrumx. I run electrumx on a raspberry pi with 8 GB RAM, there is plenty of memory available. Is this a known problem?

May 09 18:19:36 raspberrypi startElectrumX[1207]: INFO:BlockProcessor:our height: 352,987 daemon: 682,786 UTXOs 959MB hist 53MB May 09 18:20:13 raspberrypi startElectrumX[1207]: INFO:BlockProcessor:our height: 353,140 daemon: 682,786 UTXOs 961MB hist 91MB May 09 18:20:53 raspberrypi startElectrumX[1207]: INFO:BlockProcessor:our height: 353,264 daemon: 682,786 UTXOs 968MB hist 126MB May 09 18:21:38 raspberrypi startElectrumX[1207]: INFO:BlockProcessor:our height: 353,422 daemon: 682,786 UTXOs 977MB hist 169MB May 09 18:22:14 raspberrypi startElectrumX[1207]: INFO:BlockProcessor:our height: 353,527 daemon: 682,786 UTXOs 978MB hist 201MB May 09 18:22:49 raspberrypi startElectrumX[1207]: INFO:BlockProcessor:our height: 353,673 daemon: 682,786 UTXOs 997MB hist 237MB May 09 18:22:49 raspberrypi startElectrumX[1207]: INFO:DB:flushed filesystem data in 0.22s May 09 18:23:00 raspberrypi startElectrumX[1207]: INFO:History:flushed history in 11.1s for 1,126,000 addrs May 09 18:23:27 raspberrypi startElectrumX[1207]: terminate called after throwing an instance of 'std::bad_alloc' May 09 18:23:27 raspberrypi startElectrumX[1207]: what(): std::bad_alloc May 09 18:23:27 raspberrypi startElectrumX[1207]: /home/pi/startElectrumX: line 19: 1211 Aborted electrumx_server May 09 18:23:27 raspberrypi systemd[1]: electrumx.service: Main process exited, code=exited, status=134/n/a May 09 18:23:27 raspberrypi systemd[1]: electrumx.service: Failed with result 'exit-code'.

fooedge2 commented 3 years ago

Ok, seems this is related to the memory consumption. Although there is plenty of RAM available, python seems to be limited to around 2GB RAM usage. (>2.318.660 bytes ) The memory usage of electrumx_server increases over time, after around one hour the limit is reached and I get this error message. Is it normal that the memory usage increases constantly?

akhavr commented 3 years ago

I've also encountered this problem. It happens during initial block processing and only on RasbperryPi. Haven't solved it yet.