OutOfMemory in ver 1.0.0 + JRFileVirtualizer

By: Ashraf Fouad - modulo2
OutOfMemory in ver 1.0.0 + JRFileVirtualizer
2005-08-02 22:50
I have a huge record number ( more than 10,000 ) as datasource, I use JRBeanCollectionDataSource, the row I have contains 25 fields:
5 String fields
16 Float fields
1 byte field
1 short field
2 int fields

I was facing the problem of OutOfMemory in version 0.6.8, and I then used the JRFileVirtualizer as follows:

JRFileVirtualizer virt = new JRFileVirtualizer( 300, "c:\\temp" );
JapserPrint print = JasperFillManager.fillReport( "c:\\report\\xyz.jasper", param, virt );

virt.setReadOnly( true );

As the sample provided with version 1.0.0
The sample uses 2 instead of 300 as in my code, I assume this value is the number of records to be cached on the file and read -plz correct/makesure as I didn't understand from javadoc-

What I want how it is possible to compute this value to solve my problem.

I'm running on tomcat 4.1.31, should I make options to increase memory heap size, currently I'm using the standard for jdk


By: Lucian Chirita - lucianc
RE: OutOfMemory in ver 1.0.0 + JRFileVirtuali
2005-08-02 23:16

The first parameter of the JRFileVirtualizer constructor is the number of pages to be kept in memory.

As you get OutOfMemory error, 300 pages in memory is too much for your data. Try setting this to something smaller, something like 10-50.

Hope this helps,

By: Justin Luzier - chicogrande
RE: OutOfMemory in ver 1.0.0 + JRFileVirtuali
2005-08-03 13:32
On the topic of using the JRFileVirtualizer. Once a JasperPrint object is created, and ready for export, does the virtualizer clean-up the temp files created or is there a method to call to force this clean-up?

By: Lucian Chirita - lucianc
RE: OutOfMemory in ver 1.0.0 + JRFileVirtuali
2005-08-04 00:17
The files created by the virtualizer contain data used in the export process. These files actually contain data which is part of the JasperPrint object, so they can't be cleaned while this object still exists.

The files are cleaned when the virtualizer is garbage collected, i.e. when the filler and print object are no longer referenced.

2004 IR Help's picture
Joined: Aug 17 2006 - 3:49am
Last seen: 11 years 6 days ago

0 Answers:

No answers yet