Sorry for the missing image (they are likely not allowed in the list). Here’s what I see:
I have 3 org.apache.catalina.core.ApplicationContextFacade objects (I would expect only one since I have only one web app). Two of these objects are referenced by - org.apache.catalina.core.ApplicationContext (via facade property) (a) org.apache.struts2.config.StrutsXmlConfigurationProvider (via servletContext property) (b) freemarker.cache.WebappTemplateLoader (via servletContext property) The third object contains the same above and a lot of other objects (this is the “running” web app context). So it seems to me that for some reason there are two objects, (a) and (b) that are kept in memory by something that I don’t understand and these keep the old “context” and (likely) many other classes since the class loader can’t be closed; this makes my Metaspace bigger and bigger with every hot deploy. Hope someone can give me an hint on what to look into. I tried to navigate the two objects with the memory analyzer but it’s too difficult to understand what’s going on. Thanks > On 22 Feb 2025, at 11:38, Ing. Andrea Vettori <a.vett...@b2bires.com> wrote: > > Hello, > I’m facing an issue that can't fully understand myself. I’m using struts > since year 2000 (version 6.7 at the moment) in web apps with a mix of JSP and > Freemarker templates. I use Tomcat as servlet container. > Recently I found that when an app is hot deployed, I constantly find that > some non heap memory is consumed. Analyzing thread dumps I found that an > application context object is left in memory and this is referenced by a > struts related class and a FreeMarker related class (that I think is created > by struts). > For example in the image attached you can see three application contexts that > are caused by hot deploying the app two times after the tomcat server has > started. > The “bigger” context is the one of the running app. The two smaller ones are > left after the two hot deploys. If I do N hot deploys I later found the same > result with N+1 contexts. > This is consuming a lot of Metaspace at each hot deploy. > > Any hint on what can cause this ? > Thanks > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org > For additional commands, e-mail: dev-h...@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org For additional commands, e-mail: dev-h...@struts.apache.org