Unknown memory usage/leak JDK-8-265 and Wildfly 20

32 Views Asked by At

I'm a bit of a novice with JDK memory and ran into an issue with what seems like very large lists not being freed when no longer used. We use jdk8.265 with wildfly 20 using JSF (mojarra-2.1.29-11) with beans using a view scope configured by faces-config.xml. We use G1GC.

We have one bean that can sometimes load a VERY large list of custom objects. It's only about 40k records, but size maybe 50MB.

As I refresh the page that gets the list (browser ctrl-R) I see the heap memory grow in the old gen. It will sometimes go down a little, but doesn't really get GC'd. I can push the Perform GC button in visualVM and that helps a little.

Anyway, I keep reloading and it keeps growing. I navigate away from page and come back, still grows. In the picture below you can see the memory usage with reloads at 1). After 1, I navigate to other view scoped pages. Forcing a GC did not change anything. At 2) I logout, then 3) I force GC.

So the question is, why would the memory not be marked as free after reloading or navigating away from the bean? I have no finalize methods on the beans and we set no session vars. It almost looks like wildfly is hanging onto multiple copies of the bean/list until I logout.

Any ideas what we are missing?

Thank you!

Memory Usage

0

There are 0 best solutions below