[#4743] - Too many temporary font files (+~JF tmp)

Category:
Bug report
Priority:
Urgent
Status:
Closed
Project: Severity:
Major
Resolution:
Fixed
Component: Reproducibility:
Sometimes
Assigned to:

Using JasperReports creates several temporary font files for a single report. As shown in the Additional Information section, these temporary files:

- Take up a lot of disk space
- Take a lot of time to create
- If left unmonitored, result in a full temporary drive (thereby causing cascading failures)

Killing the JVM (kill -9) that is used to run JasperReports does not result in the temporary files being deleted.

Even if the files were removed upon termination, that would only help if the JVM is shut down. The JVM, in my case, is a listening server that is not supposed to be shut down.

AttachmentSize
Binary Data JR.log.gz19.63 KB
Binary Data JR-02.log.gz20.35 KB
thangalin's picture
2035
Joined: Apr 21 2008 - 4:34am
Last seen: 2 years 11 months ago

14 Comments:

#1

JasperReports 3.7.3.

$ java -version
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)

$ uname -a
Linux jaguar 2.6.31-22-generic #60-Ubuntu SMP Thu May 27 02:41:03 UTC 2010 x86_64 GNU/Linux

Evoked using:

$ java -server -Xconcurrentio -Xms128m -Xmx512m -Djava.ext.dirs=/opt/jdk1.6.0_20/jre/lib/ext:/usr/java/packages/lib/ext:. -jar JavaBridge.jar

#2

Could you enable debug logging for net.sf.jasperreports.extensions and net.sf.jasperreports.engine.util.JRLoader, rerun your application and upload the log file here?

Regards,
Lucian

#3

I could not figure out how to disable the logging for the JavaBridge. The logger is configured as follows:

$ cat log4j.properties
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=JASPERREPORTS %d [%t] %-5p %c - %m%n

log4j.logger.net.sf.jasperreports.extensions.ExtensionsEnvironment=DEBUG
log4j.logger.net.sf.jasperreports.engine.util.JRLoader=DEBUG

If you would like to see any changes to the configuration file, tell me what changes to make and I will re-run the test case with the new logging.

#4

Please change
log4j.logger.net.sf.jasperreports.extensions.ExtensionsEnvironment=DEBUG
to
log4j.logger.net.sf.jasperreports.extensions=DEBUG

Thanks,
Lucian

#5

Also, you should use
log4j.rootLogger=WARN, A1
so that debug logging is not enabled for any other code.

#6

JasperReports is being executed through a server (PHP-Java Bridge). The server filters the logging. I have had to use:

log4j.rootLogger=DEBUG, A1
...
log4j.logger.net.sf.jasperreports.extensions=DEBUG
log4j.logger.net.sf.jasperreports.engine.util.JRLoader=DEBUG

Otherwise, nothing appears in the log.

The log is now attached.

#7

The log statements do not correspond to 3.7.3 sources. Are you sure about the version?

#8

FILE LISTING

$ ls -la $(locate jasperreports | grep jar$)
-rw-r--r-- 1 user user 2963181 2010-06-02 02:22 /home/user/bin/ireport/ireport/modules/ext/jasperreports-3.7.3.jar
-rw-r--r-- 1 user user 153096 2010-06-02 02:22 /home/user/bin/ireport/ireport/modules/ext/jasperreports-chart-themes-3.7.3.jar
-rw-r--r-- 1 user user 35621 2010-06-02 02:32 /home/user/bin/ireport/ireport/modules/ext/jasperreports-extensions-3.5.3.jar
-rw-r--r-- 1 user user 2478084 2010-06-02 02:22 /home/user/bin/ireport/ireport/modules/ext/jasperreports-fonts-3.7.3.jar

PHP-JAVA BRIDGE SERVER STARTUP SCRIPT

IREPORT_HOME=/home/user/bin/ireport
$JAVA_BIN/java -server -Dlog4j.debug=true -Dlog4j.configuration=log4j.properties -Djava.awt.headless=true -Xms128m -Xmx512m -Djava.ext.dirs=$IREPORT_HOME/ireport/modules/ext:$IREPORT_HOME/ide10/modules/ext:. php.java.bridge.Standalone SERVLET_LOCAL:8080 5 bridge.log

--

I have made sure that there are no other versions of JasperReports on the computer.

I have attached some new logs, but they look just like the old logs.

#9

The new log does correspond to 3.7.3 (e.g. it has "Loading JasperReports extension properties resource" messages).

Do you have a log that spans multiple requests? We'll need to understand a little about how this PHP-Java bridge works (e.g. does it spawn new JVMs for each requests? what classloaders does it use?). Any information about that matter would help.

Regards,
Lucian

#10

PS: Do +~JF*.tmp files accumulate after the changes? Some files will be created when the JVM is started, but are files being created (and not deleted) at each request?

#11

It looks like the temporary files do not accumulate.

I wonder if it was a problem because I was using Oracle's JRockit Java Virtual Machine?

I will let you know if the problem persists.

#12

I think it was because you had JR 3.7.2 (or older) before. There was a fix related to extensions and classloaders in 3.7.3

With the new behaviour, do you still see an issue in the creation of the +~JF* temp files?

#13

I see no issues with creation of the temp files using either Oracle's JRockit 1.6.0 or JDK 1.7.0. After the bridge starts, I can generate PDFs. The /tmp directory contains temp files (as expected). Regenerating PDFs does not increase the number of temp files created.

When I terminate the bridge server application, the temporary files in /tmp are deleted.

Thanks for the help!

#14

Given your feedback, I'll mark the issue as fixed.

Regards,
Lucian

Feedback