Re: OutOfMemoryError on big text chunk

Attila Szegedi <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
I've entered this into our bug tracker:

http://sourceforge.net/tracker/index.php?func=detail&aid=1851842&group_id=794&atid=100794

I'll try to reproduce and inspect it as I can.

Attila.

On 2007.12.14., at 19:00, Mirko Nasato wrote:

> 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






-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.