GI-Joe made a cartridge that can test the RAM inside the C64. This cartridge can test the RAM chips without the use of the Kernal ROM, Basic ROM, CIA1/2 and the SID. For the cartridge he uses an old game cartridge. You must replace the game ROM with an EPROM with the firmware for the RAM tester.
Website: http://www.forum64.de