On Linux you could use limits (e.g. prlimit
et al).
For example, launching monerod
like: prlimit --rss=N monerod
, will limit the resident set size of the launched daemon to N bytes. Lots of other options in this QA as well.
Presumably there's something similar on Windows.
Note however, by reducing RAM the process can use, you'll just end up swapping. Also note, beware of making the common mistake of misinterpreting usage reported by some tool, this is because the Monero blockchain is stored in virtual memory and often either the tool or the viewer doesn't understand how to display / interpret this. For example, some tools will show Monero using 100% of RAM when in fact it may only using 5%!