Jump to content

JasperServer memory usage much higher than iReport


stelek

Recommended Posts

Hi,

We're having a problem with report generation in JasperServer. The report is bigger than anything we've done before but it's not really that huge (around 70000 records -> around 3000 PDF pages). The report generates just fine in iReport. It takes around 5-10 minutes and uses around 600MB of memory but in the end we have a nicely looking PDF/XLS file.

However, we want to allow non-developers to use the report and therefore we want to deploy it on JasperServer. Unfortunately we are not able to generate it from there. The server always crashes with OutOfMemory. We modified the settings of the server and were able to start it with 1.6GB of memory maximum but it's still not enough for this report. During generation we observe as the Java process consumes memory and at first it allocates it slowly but then at some point it suddenly starts consuming a lot and then crashes...

We would really appreciate some help here. We do not understand why the JasperServer uses that much more memory than iReport and if there's anything we can do to reduce the usage in the server. Unfortunately "JasperReports-Ultimate-Guide" says only to increase the java heap but we're not able to do this past the 1.6GB point. Is there anything else we can do?

We're using verson 3.5 but we also tried 3.7 RC with identical result.

Link to comment
Share on other sites

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

We have tried again on another machine where we were able to allocate 2.4GB for Java. The generation failed again :(

This is now four times the memory thet iReport is using and we're still not able to get the report from JasperServer...

Link to comment
Share on other sites

After some experimenting - there's a workaround. It seems the problem is caused by the "ignore pagination" option. We have it enabled because it gives us an Excel export without breaks. But then JasperServer runs out of memory. When we disabled the option the report was generated successfully but of course it does not look as nice as before...

Is there any way to use "ignore pagination" and not cause extremely high memory usage in the server?

Link to comment
Share on other sites

stelek,

I don't think there is a simple solution. The virtualizer automatically helps out to avoid such memory requirements... but the virtualizer works on pages, so when there is only one page it doesn't help much. That explains the big difference between generating with or without page breaks.

See this thread.

On the other hand, I cannot explain the significant difference you're seeing between iReport and JasperServer memory requirements. One thing to investigate is any settings in jasperreports.properties that are different between JS and iR. Also, perhaps the settings for the fileVirtualizerFactory in applicationContext.xml can be tweaked. Sorry, I don't know this feature well, so I'm only guessing that this may point you in a useful direction.

Regards,
Matt

Link to comment
Share on other sites

Was pagination ignored for the report when executed in iReport as well?  What was the output format in iReport?  Your mention of 3000 PDF pages seems to indicate that the report was paginated in iReport.

One thing to consider in JS is that having such a large report with no pagination is not necessarily a good idea.  When you execute the report (supposing that a solution to the memory problem is found), you'll get a huge HTML page which will take a lot of time to render in the browser (which will probably also use a lot of memory to render the page).

An alternative approach is to have pagination in the report but skip page headers and footers when exporting to XLS.  See the FAQ at http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/faq.html?group_id=252#FAQ28

Regards,

Lucian

Link to comment
Share on other sites

Hi. Thank you for the answer.

Yes, the pagination was ignored in iReport and the report was identical to the one on the server. I know about the number of pages because "during development" I had the option disabled, and I switched it on only after we decided to use export to XLS. So we're definitely experiencing a big difference in memory usage between iReport and JasperServer...

By the way - it's also possible to crash iReport with "ignore pagination". If you have one long page and press "show full page" button, the program hangs for a long time (well, longer than I was ready to wait anyway :) )

I have changed my report so it does not use "ignore pagination" anymore. I removed the margins, put the column header elements to the title band (so it does not repeat itself) and I made sure that all elements have a height which is a multiply of 17 (this way they always fill the A4 page and there's no additional margin left). So for this moment my problem is solved, but I believe there's still something wrong in the server. And for me it looks like it's somewhere in the "presentation layer", because the server seems to run out of memory just before the "intermediate" version of the report should show up to the user... (and the "presentation layer" is the big difference between iReport and server, isn't it?)

Link to comment
Share on other sites

  • 4 months later...

This is the same problem that we have seen since we moved from JS 3.5 to JS 3.7

 

Reports that previously worked fine in 3.5, now no longer run at all in 3.7.

 

IS_IGNORE_PAGINATION to Excel required for not so large report - 1800 records, but still doesn't complete using JS web interface. Works fine when automated at 4am - i.e. not with the web interface.

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