Jump to content
Changes to the Jaspersoft community edition download ×

Need Help!!Reducing CPU Utilisation jasper reports


Recommended Posts

Hi Teodor,

We use JASPER for our reports in one of our products and while generating the reports the CPU Utilsation on the SOLARIS server seems to touch 100% consistently and remain at 100% during the generation of the reports.

Pls note ,i have monitored the CPU utilsation using the PRSTAT command, also through the logging statements that we have put in the Code, what we could find out was during the invocation of the method JasperFillManager.fillReportToFile the Utilsation seems to shoot up drastically.I have checked the forum contents and and ensured that StretchWithOVerFlow is set to false.However, i do not see any improvement at all in CPU utilisation.

Surprisingly it does not also seem to depend on the number of records/no of columns shown in the report as well as one of the report was with 80 odd records and the CPU Utilsation has shot up.





Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic



I don't think this is specific to JasperReports.

Let's say you make an utility method that has a "for" statement iterating from 1 to 1 million.

If you call this method in your program, it will probably use the CPU at 100%, trying to count from 1 to 1 million as fast as it can.


If you don't like your method call to use the CPU at 100%, then you probably need to call it on a separate thread to which you give a lower priority.

Another option would be that during the "for" loop, from time to time you call Thread.yield(), which causes the currently executing thread to temporarily pause and allow other threads to execute.


I would first try to call the report filling process on a separate thread with lower priority. And if this is not satisfactory, then you could associate a custom -made scriptlet with your report so that Thread.yield() gets called with every page or so, during the report filling.


I hope this helps.


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