ספר המדות, Memory Memory · ד
Sefer HaMiddot 923
ד. עַל־יְדֵי צַעַר בָּא שִׁכְחָה.
4. Through suffering one comes to forgetfulness (t.n. The commentators did not provide any citation, here is a possible hint from Psalms 31:13 I have been forgotten like a dead person (who is forgotten) from the heart, I was like a lost vessel -- this can be translated and understood -- I was like a vessel that loses-forgetsl).