Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0023550 | Openbravo ERP | A. Platform | public | 2013-04-15 13:27 | 2013-04-25 14:51 |
|
Reporter | alostale | |
Assigned To | alostale | |
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0MP23 | |
Merge Request Status | |
Review Assigned To | mtaal |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0023550: MenuManager resources consumption |
Description | MenuManager is the object in charge of caching (session scoped) menu to be reused by different components.
It is generated when the session is created (on login or role change).
The problem is the amount of resources it consumes to be created and maintained. |
Steps To Reproduce | See https://issues.openbravo.com/view.php?id=23428#c57890 [^]
Following the test case proposed in that issue. MenuManager consumes ~53s to be generated for the 20 sessions (~2.65s per session).
It also retains ~7MB of heap for each session of Admin role with access to all entries. |
Proposed Solution | This can be improved by creating a "generic menu" object cached at application scope by language (one copy of the menu for each different available language).
This generic menu would be lazily created on first time it is required (this is first login after tomcat is started).
Subsequent menu requests would reuse this global menu, caching it at session scope, in the same way now it is cached to be adapted to role permissions.
In this way:
* Global menu would be generated just once, currently is done once per session. Reducing CPU consumption.
* Global menu in memory object would be shared among different session, each of them would just keep a list of pointers of the session granted menu items, this pointers would link to common object. Reducing heap usage. |
Additional Information | |
Tags | Performance |
Relationships | blocks | design defect | 0023428 | | new | AugustoMauch | When login the application the cpu consumes a lot of resources for few seconds and the memory also increases a lot |
|
Attached Files | about-menu.diff (3,737) 2013-04-15 13:30 https://issues.openbravo.com/file_download.php?file_id=6097&type=bug |
|
Issue History |
Date Modified | Username | Field | Change |
2013-04-15 13:27 | alostale | New Issue | |
2013-04-15 13:27 | alostale | Assigned To | => alostale |
2013-04-15 13:27 | alostale | Modules | => Core |
2013-04-15 13:27 | alostale | Triggers an Emergency Pack | => No |
2013-04-15 13:28 | alostale | Relationship added | blocks 0023428 |
2013-04-15 13:30 | alostale | File Added: about-menu.diff | |
2013-04-15 13:31 | alostale | Review Assigned To | => mtaal |
2013-04-15 13:39 | alostale | Note Added: 0057895 | |
2013-04-15 13:39 | alostale | Tag Attached: Performance | |
2013-04-15 13:50 | hgbot | Checkin | |
2013-04-15 13:50 | hgbot | Note Added: 0057901 | |
2013-04-15 13:50 | hgbot | Status | new => resolved |
2013-04-15 13:50 | hgbot | Resolution | open => fixed |
2013-04-15 13:50 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/b69625663ccced5c10ad3b448f15f6b0be1db159 [^] |
2013-04-16 19:18 | hudsonbot | Checkin | |
2013-04-16 19:18 | hudsonbot | Note Added: 0057978 | |
2013-04-19 18:05 | hgbot | Checkin | |
2013-04-19 18:05 | hgbot | Note Added: 0058061 | |
2013-04-22 16:36 | hudsonbot | Checkin | |
2013-04-22 16:36 | hudsonbot | Note Added: 0058105 | |
2013-04-25 14:51 | mtaal | Note Added: 0058257 | |
2013-04-25 14:51 | mtaal | Status | resolved => closed |
2013-04-25 14:51 | mtaal | Fixed in Version | => 3.0MP23 |
Notes |
|
|
Executed test case:
* Apply attached about-menu.diff.
* When opening About window, it logs generated menu javascript code for all the roles available in the system. Verified that before and after applying the fix, the generated code is identical.
Improvement:
*Before applying the fix, MenuManager consumed 1-2 seconds per session
*Before applying the fix, MenuManager retained ~7MB of heap per session
*After applying the fix, MenuManager consumes 10-300 ms per session
*After applying the fix, MenuManager still retains ~4MB per session, but these 4MB are application scoped so even retained by each session, new sessions do not increase (significantly) the global amount of memory used by MenuManager. |
|
|
(0057901)
|
hgbot
|
2013-04-15 13:50
|
|
Repository: erp/devel/pi
Changeset: b69625663ccced5c10ad3b448f15f6b0be1db159
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Apr 15 13:49:03 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b69625663ccced5c10ad3b448f15f6b0be1db159 [^]
fixed issue 23550: improved MenuManager resources consumption
Now GlobalMenu is application scoped sharing a "global generic" menu among
different sessions, preventing menu computation for each of them.
---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/MenuManager.java
M src/org/openbravo/erpCommon/utility/WindowTree.java
A modules/org.openbravo.client.application/src/org/openbravo/client/application/GlobalMenu.java
A modules/org.openbravo.client.application/src/org/openbravo/client/application/event/MenuCacheHandler.java
---
|
|
|
|
|
|
(0058061)
|
hgbot
|
2013-04-19 18:05
|
|
Repository: erp/devel/pi
Changeset: dceedab022193ae7df469b0bcd0b5d6788528d2b
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Apr 19 18:04:36 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/dceedab022193ae7df469b0bcd0b5d6788528d2b [^]
related to issue 23550: enable MenuManager to be used out of a CDI container
---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/MenuManager.java
---
|
|
|
|
|
|
(0058257)
|
mtaal
|
2013-04-25 14:51
|
|
|