Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0023550 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
design defect | [Openbravo ERP] A. Platform | major | have not tried | 2013-04-15 13:27 | 2013-04-25 14:51 | |||
Reporter | alostale | View Status | public | |||||
Assigned To | alostale | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | 3.0MP23 | |||
Status | closed | Fix in branch | Fixed in SCM revision | b69625663ccc | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Review Assigned To | mtaal | |||||||
Web browser | ||||||||
Modules | Core | |||||||
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. | |||||||
Tags | Performance | |||||||
Attached Files | about-menu.diff [^] (3,737 bytes) 2013-04-15 13:30 [Show Content] | |||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | ||||||||
|
Notes | |
(0057895) alostale (manager) 2013-04-15 13:39 |
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 (developer) 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 --- |
(0057978) hudsonbot (developer) 2013-04-16 19:18 |
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/8df08bea850d [^] Maturity status: Test |
(0058061) hgbot (developer) 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 --- |
(0058105) hudsonbot (developer) 2013-04-22 16:36 |
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/f78aa78542fa [^] Maturity status: Test |
(0058257) mtaal (manager) 2013-04-25 14:51 |
Reviewed |
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 |
Copyright © 2000 - 2009 MantisBT Group |