namecoin / namecoin-legacy

Legacy client. New version here: https://github.com/namecoin/namecoin-core Note the release branch! - Official website:

Home Page:https://namecoin.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

name_filter command is failing

muneeb-ali opened this issue · comments

With the error:

error: {"code":-1,"message":"std::bad_alloc"}

This started happening, suddenly, on a bunch of namecoind nodes (without doing any software/version updates). Any ideas re what's going on? Thanks,

Hm, that's interesting! Does restarting the nodes help? What do you see in the debug.log file? I suppose you are running 0.3.80?

These servers are on 0.3.76. Restarting the node sometimes helps and sometimes doesn't which is odd.

No log output in debug.log for this error. It just has the standard messages

e.g.,

error: {"code":-1,"message":"std::bad_alloc"}

and there is nothing in the log

AcceptToMemoryPool(): accepted 09394969ea
sending: inv (37 bytes)
sending: inv (37 bytes)
sending: inv (37 bytes)
sending: inv (37 bytes)
sending: inv (37 bytes)
sending: inv (37 bytes)
sending: inv (37 bytes)

I do think this is related to the amount of memory on the server because on a couple of high-mem servers I'm not seeing the error (at least for now)

Note first that you should (if you can) update to 0.3.80 - there was a softfork in between. (But if you do not mine, know what you are doing and are fine with it, you can also stay on the old version.)

In that case, I guess that you simply run out of memory. The old client (not Namecoin Core) queries the whole name database into memory and then runs the regexps on it. Try switching to name_scan if that is possible for your application, using more memory or updating to Namecoin Core.

Yes, I was able to pinpoint it to a memory issue last night. Adding more memory to the VM solves it. So in Namecoin Core, you're taking some other approach to the memory management of name_filter?

Yes. Namecoin Core only keeps in memory what will be the final result - i. e., all names that actually match the filter. The old client first loads all names into memory and then applies the filter on them.

Got it, thanks. Closing this issue.