I'm running geth on a system with 96GB of memory, soon to be bumped up to 192GB. I currently start geth with --cache 32768 but I plan to double it when my memory is upgraded. However, I've noticed that when geth starts up I get this message: Sanitizing cache to Go's GC limits provided=32768 updated=32188 So it seems that there is some limitation the Go is putting in place that prevents me from setting the cache larger than 32118MB. How do I raise this limit?


Some useful sources on this: here and here

A summary of those sources turns up that Go's garbage collector basically stores up to twice the memory allocated as garbage. The limit shouldn't be at 32118MB, it should be at half your memory. Since you mention that you've got 96GB, though, this raises some questions. Is it possible that you've got some ~30GB of memory allocated in a way that Geth doesn't see it? That would explain why Geth is capping you at this number. You may be able to get up to the numbers you wanted by freeing up a few GB of RAM, if this is correct. In any event, currently Geth lets you set a cache up to half your available memory, as pointed out in the sources above.

You mention that you plan on adding more memory - this should allow you to up the cache too.

The flags mentioned in the comments (under the 'Performance Tuning Options' here may help you optimize your sync, but otherwise are not able to get around the memory cap.

  • When I check system monitor I do not see anything else using memory. I have 96GB of memory because I'm running a dual processor system, and each processor uses triple channel memory. So each processor has three 16GB DIMMs. (the processors are both Intel Xeon X5690 fwiw.) – Broseph Mar 23 '20 at 12:29
  • Hmm, I'm trying to research if the dual processor should hurt your cache in any way, but I'll admit that I'm confused why it's capping you so low. I suspect that it's related to what I mentioned in the answer, that Geth caps to make sure the Go garbage collector doesn't get wacky, but am not sure. – The Renaissance Mar 23 '20 at 12:34
  • I'm trying to find out an easy way to see how much memory Geth thinks you have. The 31GB number really bothers me, as it's not half of anything, really. Do you have a way? If you have Prometheus monitoring running, it might give you an option. – The Renaissance Mar 23 '20 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.