Good day!
There is a question of the following nature: I have a cache in the program that is cleared if maxMemory is totalMemory (values are taken from runtime) less than 10mb. Clearing the cache is the usual re-creation of some structure and one of the members of which is Image. When re-creating image = null; nevertheless, at a certain stage, my memory runs out (java heap overflow).
Actually the question is: what am I doing wrong, why does memory still end with time?