Jump to content
Changes to the Jaspersoft community edition download ×

OutOfMemory in ver 1.0.0 + JRFileVirtualizer


2004 IR Help

Recommended Posts

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 1.4.2.08

 

Thanks

 

 

 

 

By: Lucian Chirita - lucianc

RE: OutOfMemory in ver 1.0.0 + JRFileVirtuali

2005-08-02 23:16

Hi

 

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,

Lucian

 

 

 

 

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.

 

Regards,

Lucian

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...