Page 1 of 1

outOfMemory problems

PostPosted: Thu Apr 08, 2010 8:35 pm
by reddd
Hi again,

finally I solved my problem to assign style to HTML parts,
so thanks a lot for your suggestions!

Now i have another problem, but needs another topic:

sometimes, after the creation of some docx using the docx4j libraries, in my logs compare an error like this:

java.lang.OutOfMemoryError: PermGen space

...and the entire application crash.
i cannot understand why, untill the fourth or the fifth docx it's all ok, but at one point the application goes wrong with the message i've just written.

some idea?!?

Thanks in advance for help,

Cheers

Red

Re: outOfMemory problems

PostPosted: Fri Apr 09, 2010 10:49 am
by jason
Hi

Some general questions and pointers:

- are you releasing references to the earlier documents so they can be garbage collected? I did a quick test, adding a new WordProcessingMLPackage to a list. With the document I chose, and my Eclipse memory settings, I could add 32 of it before I ran out of heap space.

- if you are using a FontMapper, is it adding any really large fonts? Some people have previously had problems with 30MB+ fonts.

- see http://dev.plutext.org/trac/docx4j/chan ... j/src/main which conserves memory by not loading the contents of binary parts.
You need (1) to be using LoadFromZipFile? (not NG), and (2) to have setConserveMemory(true).

- you could profile your application to see where the memory is being consumed