If you look at modern FPGAs they have prodigous amounts of on-chip memories (BRAMs and URAM in Xilinx speak).
You can buy Xilinx FPGAs on PCIe cards that could easily handle THOUSANDS of RISC-V cores.
Almost all FPGA dev boards include DDR memory so you could also put code there if you needed to.