Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0025015Openbravo ERPA. Platformpublic2013-10-24 22:252013-11-19 19:07
egoitz 
mtaal 
urgentmajoralways
closedfixed 
5
 
3.0MP30 
AugustoMauch
Core
No
0025015: Many instances of WidgetClass consuming tomcat memory
After some time using the application thousand of instances of WidgetClass are located on the memory.
-Take a memory dump of an application being used during several days.
-See on the dump using MAT that there are thousands of instances of WidgetClass
Performance
diff 25015.diff (820) 2013-11-05 00:32
https://issues.openbravo.com/file_download.php?file_id=6487&type=bug
Issue History
2013-10-24 22:25egoitzNew Issue
2013-10-24 22:25egoitzAssigned To => mtaal
2013-10-24 22:25egoitzModules => Core
2013-10-24 22:25egoitzResolution time => 1384470000
2013-10-24 22:25egoitzTriggers an Emergency Pack => No
2013-10-24 23:09egoitzTag Attached: Performance
2013-10-25 00:11shuehnerIssue Monitored: shuehner
2013-10-31 19:27johnfandlIssue Monitored: johnfandl
2013-11-05 00:32mtaalFile Added: 25015.diff
2013-11-05 00:37mtaalNote Added: 0062021
2013-11-05 17:37mtaalReview Assigned To => AugustoMauch
2013-11-05 17:37hgbotCheckin
2013-11-05 17:37hgbotNote Added: 0062031
2013-11-05 17:37hgbotStatusnew => resolved
2013-11-05 17:37hgbotResolutionopen => fixed
2013-11-05 17:37hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d152fbd22bdd2f20b8ea4377fbef386464788b9b [^]
2013-11-05 17:43hgbotCheckin
2013-11-05 17:43hgbotNote Added: 0062032
2013-11-05 17:43hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/d152fbd22bdd2f20b8ea4377fbef386464788b9b [^] => http://code.openbravo.com/erp/devel/pi/rev/900483c4a614c3afef408e7b61d7dbe7b7a5437c [^]
2013-11-13 12:28AugustoMauchNote Added: 0062123
2013-11-13 12:28AugustoMauchStatusresolved => closed
2013-11-13 12:28AugustoMauchFixed in Version => 3.0MP31
2013-11-13 12:33AugustoMauchFixed in Version3.0MP31 => 3.0MP30
2013-11-19 19:07hudsonbotCheckin
2013-11-19 19:07hudsonbotNote Added: 0062235
2013-11-19 19:07hudsonbotCheckin
2013-11-19 19:07hudsonbotNote Added: 0062236

Notes
(0062021)
mtaal   
2013-11-05 00:37   
To reproduce test, add the following lines to the DataSourceComponent.

  public DataSourceComponent() {
    System.err.println("Creating " + getClass().getName());
  }

  protected void finalize() {
    System.err.println("Finalizing " + getClass().getName());
  }

And add the following line to a place which is being called often, for example in KernelServlet.service:
System.gc()

Without the diff you see only creating datasourcecomponent lines. With the diff you see also finalizing printlns.
(0062031)
hgbot   
2013-11-05 17:37   
Repository: erp/devel/pi
Changeset: d152fbd22bdd2f20b8ea4377fbef386464788b9b
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Nov 05 10:50:44 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d152fbd22bdd2f20b8ea4377fbef386464788b9b [^]

Fixes issue 25015: Many instances of WidgetClass consuming tomcat memory
The ComponentProviders are applicationscoped, this ment that the member instances and its references were maintained throughout the lifetime of the application. Causing each time a new component being created and stored there. The change creates a new instance dynamically all the time.

---
M .project
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponentProvider.java
---
(0062032)
hgbot   
2013-11-05 17:43   
Repository: erp/devel/pi
Changeset: 900483c4a614c3afef408e7b61d7dbe7b7a5437c
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Nov 05 17:42:51 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/900483c4a614c3afef408e7b61d7dbe7b7a5437c [^]

Fixes issue 25015: Many instances of WidgetClass consuming tomcat memory
The ComponentProviders are applicationscoped, this ment that the member instances and its references were maintained throughout the lifetime of the application. Causing each time a new component being created and stored there. The change creates a new instance dynamically all the time.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponentProvider.java
---
(0062123)
AugustoMauch   
2013-11-13 12:28   
Code reviewed and verified in pi@fceec837bb81
(0062235)
hudsonbot   
2013-11-19 19:07   
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/ab71e0273dc1 [^]

Maturity status: Test
(0062236)
hudsonbot   
2013-11-19 19:07   
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/ab71e0273dc1 [^]

Maturity status: Test