freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ashwini kuntamukkala (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FREEMARKER-32) Memory Leak
Date Thu, 25 Aug 2016 19:41:21 GMT
ashwini kuntamukkala created FREEMARKER-32:
----------------------------------------------

             Summary: Memory Leak
                 Key: FREEMARKER-32
                 URL: https://issues.apache.org/jira/browse/FREEMARKER-32
             Project: Apache Freemarker
          Issue Type: Bug
          Components: engine
    Affects Versions: 2.3.23
         Environment: Linux, JDK 1.8
            Reporter: ashwini kuntamukkala


When processing over 2000 calls to hydrate a freemarker template with supplied pojos, the
app server hosting the web app goes out of memory. When I looked at the head dump, the freemarker.template.DefaultObjectWrapper's
classInstrospector instance of freemarker.ext.beans.ClassIntrospector  seems to holding on
to instance of pojos apparently in a hashmap. 

freemarker.ext.beans.ClassIntrospector  -->  java.util.concurrent.ConcurrentHashMap -->
.\java.util.concurrent.ConcurrentHashMap$Segment[16] 

I am initializing the set up in this way once when the application boots up

cfg = new Configuration(new Version(2, 3, 23));
cfg.setDefaultEncoding("UTF-8");
cfg.setLocale(Locale.US);
cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
cfg.setClassForTemplateLoading(FreemarkerTransformer.class,
				"/templates");

So during a burst of calls, I run out of 512M of PermGenSize on my JVM. 

Is there a workaround to solve this problem?

Thank you
Ashwin



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message