| Let's summarize this issue:
- the query plan cache is bounded (via hibernate.query.plan_cache_max_size set by default to 2048);
- given the LIRS cache algorithm using by the query plan cache, calling clean up does not really remove the elements from the cache: it only invalidates the elements and they will be replaced by others when new objects will be added to the cache.
So the important point here is that we don't have any memory leak. I will add a comment in the source code explaining what you can expect from the query plan cache cleanup method. As for Ranjith issue, I think it's a matter of sizing the cache as he has a lot of HQL queries from different applications. Note that I suspect the HQLQueryPlan objects are significantly bigger than what we would have liked and I posted something to the hibernate-dev mailing list to discuss this subject. |