Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0019810Openbravo ERPA. Platformpublic2012-02-20 10:392012-03-02 15:38
alostale 
alostale 
urgentmajoralways
closedfixed 
5
 
3.0MP9 
Core
No
0019810: ViewComponent memory leak
Whenever a window in opened and the request reaches the backend (it is not cached in client), a new instance of ViewComponent class is created and it is never cleaned up from memory.

This causes heap memory usage to rapidly increase as ViewComponent instances can be heavy (up to 4MB).

Attached you can see graphs of part of a heap dump suffering this issue.
-Execute the attached script that does 25 calls to backed for new windows.
-Check heap increases with as many ViewComponent instances as opened windows.
No tags attached.
png Selection_031.png (37,363) 2012-02-20 10:39
https://issues.openbravo.com/file_download.php?file_id=5008&type=bug
png

png Selection_032.png (150,567) 2012-02-20 10:40
https://issues.openbravo.com/file_download.php?file_id=5009&type=bug
png

html test.html (1,073) 2012-02-20 10:40
https://issues.openbravo.com/file_download.php?file_id=5010&type=bug
Issue History
2012-02-20 10:39alostaleNew Issue
2012-02-20 10:39alostaleAssigned To => alostale
2012-02-20 10:39alostaleModules => Core
2012-02-20 10:39alostaleFile Added: Selection_031.png
2012-02-20 10:40alostaleFile Added: Selection_032.png
2012-02-20 10:40alostaleFile Added: test.html
2012-02-20 10:42hgbotCheckin
2012-02-20 10:42hgbotNote Added: 0045258
2012-02-20 10:42hgbotStatusnew => resolved
2012-02-20 10:42hgbotResolutionopen => fixed
2012-02-20 10:42hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c3105cd9c9c4ebd834baceababedddf88de4fdb2 [^]
2012-02-20 10:44alostaleNote Added: 0045259
2012-02-21 17:24marvintmStatusresolved => closed
2012-03-02 15:38hudsonbotCheckin
2012-03-02 15:38hudsonbotNote Added: 0045890

Notes
(0045258)
hgbot   
2012-02-20 10:42   
Repository: erp/devel/pi
Changeset: c3105cd9c9c4ebd834baceababedddf88de4fdb2
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Feb 20 10:42:20 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c3105cd9c9c4ebd834baceababedddf88de4fdb2 [^]

fixed bug 19810: ViewComponent memory leak

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/ViewComponent.java
---
(0045259)
alostale   
2012-02-20 10:44   
The fix for this issue makes changes scope of ViewComponent from default to RequestScope. It is riskless as ViewComponent instances are never reused, in this way Weld is aware the instance is not needed to be kept in memory.

Test plan:
-Execute the test defined in the steps to reproduce and check there are no ViewComponent instances within memory.
(0045890)
hudsonbot   
2012-03-02 15:38   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/544d64e0c159 [^]

Maturity status: Test