I have a query, i'm reading emails from gmail and storing the content of that in my database.
so as part of this i can see that multiple IMAPFolder objects are present and occupying most of the heap space and resulting in out of memory error.
The objects are not being garbage collected.
can see that messageCache is having the size of the number of emails present in gmail.
Could you please suggest here on how we can make sure IMAPFolder objects are cleared?