As reported by Mirko Nasato on the freemarker-user list:
Hi all,
I'm processing a 5.7M XML template through FreeMarker (version 2.3.11). With -Xmx128m I get an OutOfMemoryError
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2882)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
at java.lang.StringBuffer.append(StringBuffer.java:224)
at freemarker.core.FMParser.PCData(FMParser.java:2497)
at freemarker.core.FMParser.Content(FMParser.java:2570)
at freemarker.core.FMParser.OptionalBlock (FMParser.java:2784)
at freemarker.core.FMParser.Root(FMParser.java:2956)
with -Xmx192m it works.
The template does not actually contain any FreeMarker instructions (it's an ad hoc test to reproduce the problem). If I put a random expression like ${foo!} in the middle of the document then it works with less memory, -Xmx96m is enough.
So I guess the problem may be with big chunks of text without any expressions (TextBlock?). But the whole file being 5.7M, why does it need more than 128M to do the parsing?
Thanks
Mirko
Attila Szegedi
Parsing
None
Public
|
Date: 2008-04-19 03:27:37 PDT
|
|
Date: 2008-04-18 14:01:53 PDT
|
|
Date: 2008-04-03 02:45:11 PDT
|
|
Date: 2007-12-28 01:54:04 PST
|
|
Date: 2007-12-27 22:50:37 PST
|
|
Date: 2007-12-16 14:11:25 PST Logged In: NO |
|
Date: 2007-12-16 06:08:21 PST
|
| Field | Old Value | Date | By |
|---|---|---|---|
| resolution_id | None | 2008-04-03 02:45:11 PDT | szegedia |