Ability to limit RAM memory usage via litecoin.conf or other means?

Hi Litecoiners, I am running a node on a cheap VPS mainly to learn. So I just wanted to know if there is the possibility to limit memory allocation to a process, so to not run the risk to trigger the oom-killer? I am looking for a variant so that the process itself is aware how much memory it should use… (Of course, one could disable the oom-killer or give the litecoin process a higher priority*, not running the qt-GUI, but wouldn’t it be elegant if the litecoin process itself was aware about how much memory to allocate at max?)

grep "Killed process" /var/log/syslog
kernel: Out of memory: Killed process 1696 (litecoin-qt) total-vm:5752692kB, anon-rss:2163576kB, file-rss:3464kB, shmem-rss:2688kB, UID:1000 pgtables:12264kB oom_score_adj:0

additional info:
litecoin 0.21.3, qt-GUI variant

Adjust /proc/<PID>/oom_score_adj to -1000 (which automatically takes oom_adj to -17 and oom_score to 0). *

4 Likes

OK, I finally switched from litecoin-qt to litecoin-cli … hate it :wink:
3 GB RAM wasn’t enough for Ubuntu24 Server + XRDP + Litecoin-qt, even after giving Litecoin-qt high priority (the Out-of-memory just would occur with other important processes)…
3GB RAM seems to be sufficient now; litecoind deamon process is running stable now…I don’t know much about command line nodes.
OK, but thanks to this post I learned how to extract some info about the state of the node (there is no colorful, animated, fancy progress bar in the shell :wink: )

I got incoming port 9333 open, with proven connectivity, but no active connections…
So, just to understand the current status of my node: Given the block-time of Litecoin being “2778598” and this equals headers number of ./litecoin-cli --getinfo, this means the node is online, right?

  • and if blocks number is below headers number means that my node is still syncing with the network or validating old block or something, right? I got a high CPU-load which would also point in this direction…
  "blocks": 2342179,
  "headers": 2778598,
3 Likes