求助:生成pdf文档,出现outOfMemoryError
我在用itext生成PDF文档时,用一个for叠代出5000行的文档(大约127页),此时文档可以正常生成,并且非常漂亮
但是,当我将for循环5000以上时,我的文档就不能生成, 编译器生成时就会出现java.lang.OutOfMemoryError
Exception in thread "main" 的错误,但是此时我的内存还有270M没有用呢! 我想问一下那个高手系统里面有这样的问题的话,如何解决?
问题点数:60、回复次数:2Top
1 楼nicolas2(霹雳小猪)回复于 2003-11-03 13:15:32 得分 60
启动的时间设定最大内存
java -Xmx256M
试试看Top
2 楼updatedb(updatedb)回复于 2003-11-03 22:10:33 得分 0
When you add objects to a Document, these objects are written to the outputstream as soon as possible. But when you construct a table, the Table-object keeps on growing. For really large tables, this can become a problem.
Also, if you are writing to a the outputstream of a HttpServletResponse-object, the timeout of the browser can be reached.
That is why it can be useful to control the 'table-breaks' yourself, using the fitsPage()-methods in class PdfWriter
:)Top




