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

memory leakage while generating swap file with string as aparameter in to jasper


rebello.roy

Recommended Posts

i am generating pdf report using jasper(1.2.6).Its a simple logic where i am passing data as string in to jasper.I am just using the string variable in jasper and printing the content which sometimes contains huge data.

 

I our app server while generating swap file it is eating around 14 GB memory and application got hanged.Please suggest the cause and solution if someone is familia with the issue

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

maybe the problem is in the compiling of the jrxml, that's a common memory leakage problem. Instead of something like this 

JasperCompileManager.compileReportToFile(inputFile, destinationFile);

try

String inputFile = 
session.getServletContext().getRealPath("InputFile.jrxml");

String destinationFile = 
session.getServletContext().getRealPath("InputFile.jasper");

File jasperFile = new File(destinationFile);

if(environmentBeanFile.exists() == false)
{
JasperCompileManager.compileReportToFile(inputFile, destinationFile);
}

 

 

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