Let's say I iterate over all the PsiClass of a project and process them in a specific way by exploring all the PsiElement of those classes. Keeping no reference at all to the PsiClass instances I got no problem regarding the memory usage.
But if I keep a reference for each PsiClass in a list, I got an out of memory error (using the -Xms option is not solution as I can always find a bigger project)...
Does it mean that IDEA is internally using a cache and that I should never keep any reference to Psi elements for a long time so that this mechanism can work properly?
Thanks for your help,