I am not sure about RAM but definitely you might need 100s of GB space for local cache. restic at the moment does not have any mechanism to limit its size. It only depends on repo data. You find many threads on this forum where people can’t run prune as they do not have enough disk space for cache e.g. Massive cache size? - #7 by CendioOssman.
There is no simple formula to estimate its size - but more snapshots and more data changes bigger cache becomes.