serge_220 wrote:1M is tiny, I'm surprised it works at all.
ok, I'll try to increase size of the heap.
how big should it be in general?If you don't specify the heap size, the JVM will give a nice default. Unless you're fine tuning the application, you can let the JVM decide for you.
and do you mean that the size of the heap depends on the size of a doc?To some extent probably yes.
serge_220 wrote:Yes the exception clearly indicates that you're running out of heap space. And the fact that you keep running out of heap space even when enlarging it means that your application is bleeding memory. But without the code to investigate, nobody can help you find the source of the problem. Its not like you're hunting for some issue with the printing API here, its your code that is likely faulty.
Right. My hope was (mostly) that somone saw the problem like the one mentioned or exception could shed some light.