The only definitive way to know if RAM is the issue is to remove RAM in pairs until you find the pair that is causing the problem. Then replace the pair. A pair is usually one from Riser A and the matching slot in Riser B.
terminal error and shuts down
You are playing a little loosely with the terminology.
Do you get kernel panics? If so, those are logged, and you can look at the log and try to determine the cause of the problem.
Do you mean your Mac Powers Off? that is most often caused by overheating, which is most often caused by dust bunnies inside -- but do not vacuum !!
Home vacuum cleaners plastic wands generate large static charges that can kill electronics. Move your Mac to an area where you don't care about dust and blast them airborne and out of your Mac with compressed air.