This error occurs if the Java VM has run out of memory. A Java VM has a specified amount of available memory. The default value is 64 MB. This means that even if you have 2 GB of memory, the Java VM can use memory up to this limit of 64 MB, only.
To solve this problem you can increase the memory heap of the JVM or modify the reports so that fewer records are fetched per report or the report contains fewer summary fields etc.
With the command line parameter ”-Xmx” you can specify the maximum memory for the JVM, e.g. for 128 MB:
java -Xmx128m …
You should never set a value that is larger than your physical memory, as this would greatly reduce the performance.
If increasing the Java VM memory does not solve the error or you can't raise it, then you should check the reason why i-net Clear Reports needs so much memory. For the following things the Java VM needs memory:
First you should calculate the needed memory. The memory that is needed for the pure data is approximately:
[field count] * 16 bytes * rows
Fields are: database fields , SQL expression fields, summary fields, and formula fields with WhileReadingRecords.
For String fields you'll need to calculate additional 2 bytes for every character.
Additionally, some JDBC drivers cache types and also stores the complete results in the memory. This can be a large problem if your “Record Selection Formula” is not executable directly on the database or you fetch a lot of records.
If you calculate that the memory -used for the data- is larger than 10% of the memory that is available for the Java VM, then it could be the problem. You can reduce the amount of memory needed with the following actions:
If your report has many rows (for example a hundred thousand or more) and you have one or more groups in the report then you can split it into a main and sub report. The idea is that the main report has only one row per group. And an instance of the sub report has only the rows for one group. This causes the count of rows and columns to be reduced.
Steps to do this:
Now we want to reduce the count of rows for every group in the main report to 1. If your group header or footer has no summary fields that are based on the group then you can enable “Select distinct rows” in the “Summary Info” dialog. If you use summary fields based on the group then it is more difficult.
SELECT TABLE.col1, sum(TABLE.col2) AS sum_col2, count(TABLE.col3) AS count_col3, TABLE.col4 FROM TABLE TABLE GROUP BY TABLE.col1, TABLE.col4 ORDER BY TABLE.col1
How large are the rendering results? Save the result as a file. Is it many mega bytes large? If you use large images or many small images, then this is a major factor on large rendering results. That applies to your JavaBeans using image mode, as well. With file formats that do not support drawing (for example), charts can also be a problem. Remove these image objects or reduce their pixel size.
If you can't change the L&F then you'll need to use a hard disk or database cache. This works with i-net Clear Reports Plus, only. If you want to test whether it solves your problem, then you can request a trial license key for the i-net Clear Reports PLUS edition from our i-net Clear Reports support team.
i-net software strives to provide accurate product documentation. Please give us your feedback using the form below.
NOTE: This form is for documentation feedback only. For technical assistance, please send an email to clearreports@inetsoftware.de.