Jump to content
We've recently updated our Privacy Statement, available here ×

jasper reports memory issue


kiran_raja

Recommended Posts

Hi ,

I have an requirement where my datasource contains lists of list,that is, i have created a list containing 3 lists. And each list values must be listed in 3 different sheets(there are about 9000+ records in each list). All the three sheets make use the same jrxml file. Is there a way that i can pass my datasource to JasperFillManager and it creates 3 sheets in one call.Please help.

I am presently, iterating the list and calling JasperFillManagert to create 3 JasperPrint Objects. And then merging them into in one report by setting the JRExporterParameter.JASPER_PRINT_LIST parameter.This is taking a lot of memory, and in some instances goes out of memory. I need to avoid creating three jasperprint objects and the filling has to be done in one call so that i have only one jasper print object to export.

Thanks,
 

Kiran

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Hi all,

I have gone a step further and serialized my jasperprint objects in the primary storage.  I saw a example code posted by Lucian on this forum about a serialized list. This list picks the serialized files one by one during export , hence the memory used is considerably reduced and reports are generated for 40,000 records like a charm.(My Application memory heap size is 512MB)

Now , in my application, i came across a scenario where i have to handle some 50,000 records. I am getting the out of memory  error again. I saw that the jasperprint objects size created is 40MB+ each. Now when the exporter deserializes the file to genrate the final report , i am getting this error.

Can anything be done to reduce the Jasperprint object size. that will help the exporter to use lesser memory space. Any help would be greatly appreciated.

I also had a question, whether the virtualizer can be used while exporting the report. If yes, can anyone share the procedure/code.

Thanks in advance,

- Kiran



Post Edited by kiran_raja at 11/06/2009 11:23
Link to comment
Share on other sites

  • 4 weeks later...

You can use virtualizers to reduce the memory used by JasperPrint objects.  Note however that virtualizers will have no effect on the memory used by the exporter itself, and the XLS exporter does use significant memory because it keeps the generated sheets in memory.

Regards,

Lucian

Link to comment
Share on other sites

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...