[ https://issues.apache.org/jira/browse/OOZIE-1186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13561931#comment-13561931 ]
Virag Kothari commented on OOZIE-1186: -------------------------------------- I did some testing to figure out the effect of flush() I created a bufferedimage with width and height of 3000*3000. As RGB is used, each pixel occupies a 'int'. So the buffered image instance occupies around (3000*3000*4/(1024*1024) MB. I then tried with and without img.flush() but no difference in memory consumption to make any conclusion. Basically, only the garbage collector will reclaim the databuffer when the img instance is out of scope. So, ideally we should be creating a image which can be written serially to disk (row by row) instead of bringing it entirely in memory. But that would be non-trivial with the graph library being used. So, short term fix would be increase the tomcat memory if OOM's are seen. But, it would be good to have flush() which will flush any system resources used for rendering the image. dispose() is not required as its already called by the component's paintAll() method. > Image load for Job DAG visualization should handle resources better > ------------------------------------------------------------------- > > Key: OOZIE-1186 > URL: https://issues.apache.org/jira/browse/OOZIE-1186 > Project: Oozie > Issue Type: Bug > Affects Versions: trunk, 3.3.1 > Reporter: Mona Chitnis > Assignee: Mona Chitnis > Fix For: trunk, 3.3.1 > > Attachments: HeapMemoryExistingTrunkCode.png, > HeapMemoryWithPatchedCode.png, OOZIE-1186.patch > > > The Job DAG visualization loads an image into memory to be streamed on > outputstream. However, it does not free up memory and I/O resources leading > to 'Out of Java heap space' errors. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira