i am not a security professional and i am recalling what i have read before. as mentioned some malware targets the bootloader and is persistantly loaded at startup. i am not sure what is technically correct, so maybe someone will chime in, but i don't believe ram is typically cleared after shutdown. i think it is called memory only malware. either way, i have 2 comparible 4gb ram sticks and there is only one on the pc now. so i would simply swap it for newer sticks i have to get more ram if simply performance as the storage is HDD.
The bootloader resides in the hard drive so if the bootloader is infected, it will get transferred to ram at boot. Ram cannot contain a virus, you are wasting your time by replacing it.