Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to limit heap space usage?(java.lang.OutOfMemoryError: Java heap space in RunTask)
How to limit heap space usage? [message #1388972] Fri, 27 June 2014 06:40 Go to next message
David Basilashvili is currently offline David BasilashviliFriend
Messages: 6
Registered: February 2014
Junior Member
Hello!

I use runtime BIRT. My maven dependency:
<dependency>
	<groupId>org.eclipse.birt.runtime</groupId>
	<artifactId>org.eclipse.birt.runtime</artifactId>
	<version>4.3.1</version>
</dependency>


I generate big report. Result set contains 290244 rows. It requires a lot of heap space. I use Oracle DB and can constrain count of rows in result set with rownum construction: ... where rownum <= x, where x - count of rows.

I tried to analyze the dependence of row number and heap memory with Java VisualVM. This is approximate result of my analyze on one report with same parameters and different row count in resuls set:
 ROW COUNT | USED HEAP
 ----------+----------
  150000   |  <900m
  200000   |  <1000m (+ I think gc has been called)
  250000   |  out of memory on 1024m heap in RunTask
  290244   |  out of memory on 1024m heap in RunTask


index.php/fa/18392/0/
index.php/fa/18393/0/
index.php/fa/18394/0/
index.php/fa/18395/0/
index.php/fa/18396/0/

I can increace java heap size. But if row count grow, I get OutOfMemoryError sometime...

How and where to configure BIRT to not be afraid of out of memory error. How to limit memory for birt usage?

Re: How to limit heap space usage? [message #1389267 is a reply to message #1388972] Fri, 27 June 2014 15:05 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

You might take a look at this post from the BIRT Developer Center DevShare. Let me know if it helps.

http://developer.actuate.com/community/forum/index.php?/files/file/206-limit-birt-heap-usage-to-avoid-outofmemoryerror/


Michael

Developer Evangelist, Silanis
Re: How to limit heap space usage? [message #1390926 is a reply to message #1389267] Mon, 30 June 2014 07:30 Go to previous messageGo to next message
David Basilashvili is currently offline David BasilashviliFriend
Messages: 6
Registered: February 2014
Junior Member
Hello Michael!

In that post author saggest to cache the EngineConfig, IReportEngine and the IReportRunnable in static variables. This is elegant approach for synchronous report generation, I think.

But in my example I run only one report. My actions were as follows:
1. set new rownum for report select
2. start tomcat with 1024m heap size
3. start Java VisualVM
4. run report
5. get stats
6. stop tomcat and go to 1.

Your link can help me in future for synchronous report generation, but now I have another problem: on one report with same parameters but different row count in result set BIRT pojo consumes different memory size without limit.

How I can limit this consumption?

For example, I want something as follows:

I set to 700m some magic option for limit memory using. May be it is option for whole BIRT, may be it is option for single report... And I get this results:
 ROW COUNT | USED HEAP
 ----------+----------
   10000   |  <500m
   50000   |  <600m
  100000   |  <700m
  150000   |  <700m
  250000   |  <700m
  290244   |  <700m

Re: How to limit heap space usage? [message #1401904 is a reply to message #1390926] Wed, 16 July 2014 08:25 Go to previous message
Henning von Bargen is currently offline Henning von BargenFriend
Messages: 23
Registered: May 2011
Junior Member
There isn't much you can do about this.
For this huge number of rows, BIRT is not the tool of choice.
BIRT is made for creating formatted output.
Even with minimal formatting, you probably have 1 line printed per row, e.g. 80 lines per A4 page.
That's 8000 pages for 240000 rows. I'm sure nobody is ever going to read this.
You should use SQL*plus, or a little program in your favorite programming language to generate this kind of reports.

That said, BIRT creates the formatted output in memory. That's probably several hundred bytes formatting and java object overhead for each word in your output.

And BIRT caches the dataset's output by default. You could try to turn of the dataset caching for this dataset, but this will only stretch the limit a bit...

On the other hand, if you don't want to output every row, but just want to do some grouping and aggregation (count, sum, average, min, max, ...), this should be done using SQL inside the DB. The DB is made for this kind of queries.
Previous Topic:Birt 4.3.2 calendar date parameter
Next Topic:Optional Report Parameter
Goto Forum:
  


Current Time: Tue Sep 24 22:29:56 GMT 2024

Powered by FUDForum. Page generated in 0.03065 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top