Out of memory for large report [message #1416814] |
Thu, 04 September 2014 16:43  |
Eclipse User |
|
|
|
Hi, does any one have experience on how to handle "Out of Memory" when the birt report is very large, e.g. thousands of pages.
My web server hosting website and using birt report engine (running on same server) to render report. When there are a few requests to request same birt large report, the server threw "Out of memoey" error.
The server has a restriction of 3G memory (32 bits jvm) and has no quick plan to change it to 64bits.
Under this situation, any recommended solution to avoid the out of memory of server. If there are multiple requests of the same large report around same time, it has risks of bring down the server, which is a big problem.
I wonder if below ways might work or not, hope any one could give some advices:
1) pagination
so don't return all pages, only show one page;
Not sure how easy it could be implemented because the app need to record total pages count and pass the prev/next page number
2) Birt web viewer
which has built-in pagination. But not sure if still the memory still hold the whole report. Same amount of memoery is consumed as not using web viewer.
3) independent Birt iServer, not using my server to both host the website and render report using same memory.
This need to pay money
any others? Appreciate any suggestions or experiences
[Updated on: Tue, 14 October 2014 10:55] by Moderator
|
|
|
|
|
|
Re: Out of memory for large report [message #1436394 is a reply to message #1434040] |
Thu, 02 October 2014 17:14   |
Eclipse User |
|
|
|
Thank you Michael.
I tried using two separate tasks for run and render. And originally the birt report creator return file content (in byte[] type) to front end code, I changed to let renderOption directly output to httpServletResponse's outputstream.
The result turned out to be even worse:
max Memory usage increased 60%. ( The max memory usage is that I use tools to see the max memory used, minus the memory usage just before the report request was made)
Performance: time spent in run and rendering the report increase a little longer.
The runTask spend the same amount of the time as previouse runAndRenderTask.
And renderTask itself take its own time. So the extra time is on the renderTask, which is quite fast compared with runTask
An experiment of dataengine hint on memory seem not helpful. There's no memory usage different noticed with or without below hint.
task.getAppContext().put(DataEngine.MEMORY_USAGE, DataEngine.MEMORY_USAGE_CONSERVATIVE);
So in my understanding, even pagination will not help the performance since pagination requires to have to two task (run and render) and it showed me that using two tasks significantly use more memory, even if I only set to show one single page on screen, the memory usage will still increase greatly. (I didn't test it but above experiment made me this impression)
Then I might be out of options. Is there any other birt engine API provide some hint on memory usage, or other API methods which may help use less memory?
[Updated on: Thu, 02 October 2014 17:16] by Moderator
|
|
|
|
Re: Out of memory for large report [message #1445622 is a reply to message #1441660] |
Wed, 15 October 2014 13:59  |
Eclipse User |
|
|
|
Michael, thank you for your input.
So far it's required to have one report. The largest report has about 800 pages. It's probably not very big.
More exactly, I wonder what the possible options we have, to user Birt to create large report. Below options were experimented but didn't seem to help.
1) Pagination. Not working since this requires separating run and render tasks, which seems need much more memory (maybe when the rptdocument is generated)
2) RenderOption output to http servlet response's stream directly. Did not notice memory usage was less.
3) Web viewer: this has not tried, but I imagine the memory usage should be about the same.
4) memory hint setting for RunTask didn't seem to improve memory usage.
task.getAppContext().put(DataEngine.MEMORY_USAGE, DataEngine.MEMORY_USAGE_CONSERVATIVE);
I guess the options left are:
1) use a separate report server to generate birt report
2) enhance report design file to shrink the size of the report especially HTML format.
3) stop supporting real-time reporting; schedule back-end process to generate
report. Give users pre-generated reports when they request.
4) as Michael suggested, split the reports or sql data range
Appreciate your input
[Updated on: Wed, 15 October 2014 14:00] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03074 seconds