A refresh rate of a random-access memory (RAM) is increased if a number of errors is greater than an error threshold and the refresh rate has not reached a maximum rate. The refresh rate of the RAM is set to a normal rate if the number of errors is less than or equal to the error threshold.