Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
The problem out of memory in BIRT
DavidBirt
Hi<br />
<br />
In my application,report data is from web service.<br />
Then through java application analysis and transfer data list to report file.<br />
<br />
I put data list into "AppContextValue" as below:<br />
<br />
<strong class='bbc'><br />
request.getSession().setAttribute("AppContextKey", "map");<br />
Map<String,Object> map = (HashMap<String,Object>)request.getSession().getAttribute("AppContextValue");<br />
map.put("list", mylist);<br />
map.put("name", obj.getName());<br />
</strong><br />
<br />
To get it in report design file used as this:<br />
<br />
<strong class='bbc'><br />
dataList = reportContext.getAppContext().get("map").get("list").iterator();<br />
params["hotelName"]=reportContext.getAppContext().get("map").get("name");<br />
</strong><br />
<br />
And fetch this dataList in fetch script function.<br />
The dataList is a very huge.<br />
<br />
When i run this report,system just crashed and report a "Java heap space" OutOfMemoryError message.at that time system run very slowly. How can i do? :wacko: <br />
<br />
Please help me,thanks in advance.
Find more posts tagged with
Comments
CBR
Hi,
what's your birt version? 2.6 has some serious memory leaks in the ScriptedDataSet plugin code.
I do not clearly understand your problem.
You fetch data from a webservice and store that data in the session object? I would not do that if the data list is very huge (this will cause problems to your server becaue it has to hold that list in memory or serialize it to disc. So each time that user fires a request it will deserialize that list into memory. Things are getting even worse if you do not remove these list but keep adding new ones.
It s quite normal that the system gets really slow when there is no more memory available.
You can try to increase the heap size by starting your application (or the server) with -Xmx1000m
Just replace 1000 with the memory size you want (there is a limit of 2GB for 32 Bit systems).
Another and maybe better approach would be to rethink about your approach.
DavidBirt
Hi cbrell
Thank you for reply.
I use 2.5.1. Does this version has memory leak problem?
The whole process that deal with data from web service is in the java.In the java application,it gets ready for data list and put it into session. BIRT report engine gets the data list and fetch.
1.If i still do like before,how to clear session object when report file shows up?
2.If i don't use session to transfer data list,how to let birt engine get this list?
Follow what your said,i increased the heap size -Xmx1000m for Tomcat,system memory consume is still large. I have a screenshot please refer to attached file.
DavidBirt
By cbrell's advice, i added 'reportContext.getAppContext().clear()' in afterRender script function,and removed script data set fetch function in rptdesign file,instead of using handler class to fetch data,system performance has a boost.
Thank you cbrell!