My explanation could be considered canon. In ANH Owen tells Luke to take the droids to get their memories wipped, just after they bought them from the Jawas and Luke thinks they belong to somebody else.
You can then conclude that it might not be every six months but it does happen, and 3po is an old droid so most likely at one time or another before he met Luke is memory was wipped.
"Dulce bellum inexpertis."
(Sweet is war to those who have never experinced it.) Roman Proverb