Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does my relational tables throw OutOfMemoryError?

I am using iReport to build jaspersoft reports and I am using Fishbowl as my DBMS.

I built my tables and in iReport is shows that my tables are relational but for some reason it is throwing me errors and will not run. It should be very simple. I am taking in a zipcode, date range or State Name and outputing the productName, total quantity fulfilled, zip and state abbreviation.

When I do upload the report to Fishbowl it runs but eventually crashes with an error saying it's out of memory. I do not believe this is the issue but it is an effect of what ever is causing the report to not run correctly. Maybe it's my joins?

Here is my SQL

SELECT
 STATECONST."CODE" AS STATECONST_CODE,
 ADDRESS."STATEID" AS ADDRESS_STATEID,
 ADDRESS."ZIP" AS ADDRESS_ZIP,
 SOITEM."PRODUCTNUM" AS SOITEM_PRODUCTNUM,
 SOITEM."QTYFULFILLED" AS SOITEM_QTYFULFILLED
FROM
 "STATECONST" STATECONST INNER JOIN "ADDRESS" ADDRESS ON STATECONST."ID" =     ADDRESS."STATEID"
 INNER JOIN "ACCOUNT" ACCOUNT ON ADDRESS."ACCOUNTID" = ACCOUNT."ID"
 INNER JOIN "CUSTOMER" CUSTOMER ON ACCOUNT."ID" = CUSTOMER."ACCOUNTID"
 INNER JOIN "SO" SO ON CUSTOMER."ID" = SO."CUSTOMERID"
 INNER JOIN "SOITEM" SOITEM ON SO."ID" = SOITEM."SOID"

The error is:

java.lang.OutOfMemoryError : Java heap space

Here are some screenshots to help as well.

enter image description here

enter image description here

enter image description here

like image 668
Ashton Avatar asked Dec 18 '25 12:12

Ashton


1 Answers

When you have out of memory the general action is:

Java heap space out of memory

Related to jasper report it generates by default the entire report in memory, this can be changed using JRVirtualizer, see example in sample reference

Example (from sample reference using file virtualizer)

//Create the virtualizer after 2 pages filled save in tmp director
JRFileVirtualizer virtualizer = new JRFileVirtualizer(2, "tmp");

//Preparing parameters
Map parameters = new HashMap();
parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);
like image 141
Petter Friberg Avatar answered Dec 21 '25 04:12

Petter Friberg