Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036559Openbravo ERPA. Platformpublic2017-08-01 09:022017-09-18 18:23
aferraz 
alostale 
normalminorhave not tried
closedfixed 
5
 
3.0PR17Q4 
alostale
Core
No
0036559: Old callouts should be refactored to implement SimpleCallout
Callouts that do not extend SimpleCallout are defined as Servlets (as this is how 2.50 technology worked), they executed as follows:

1. A fake request is created to invoke them as a Servlet
2. That request is used to write the response in as a String representing JavaSript code
3. That string is evaluated, parsed and executed as JavaScript in server
4. To finally set the values it requires

In addition to all the overhead involved in each of the steps described above, step 3 generates bytecodes from JavaScript that are stored in PermGen memory space. This causes excessive PermGen consumption as well as it trigger Major GC Collections even with a low heap use.

All these steps are avoided for SimpleCallout since PR16Q4 0032366
To emulate it:

1. Apply attached diff that executes step 3 defined in description 2K times per callout
2. Limit PermGen (ie. 160MB) and monitor JVM
3. Open Sales Order window and click on new (this executes SL_Order_DocType and SL_Order_PriceList callouts)
  -> Check JVM graphs during execution (see attached image):
      * PermGen rapidly increases
      * This is caused to a big number of classes loaded
      * Finally, major GC collection cycles are triggered

To detect wrong callouts, apply detect-callouts.diff and execute ClassLoaderTest.

This is the list of 10 Platform callouts obtained in current pi:
- SL_IsDefault
- SL_Column
- SL_AlertRule_SQL
- FixedValueExpressionCallout
- Activation_Message
- SL_ModuleCallout
- SL_Module_Minor_Version
- SL_TableAudit
- DefaultExpressionCallout
- SelectorFieldPropertyCallout
No tags attached.
related to defect 0036882 closed caristu There exists some old callouts in core still not refactored to SimpleCallout 
depends on defect 0036599 closed alostale API change: platform callouts now implement SimpleCallout 
related to design defect 0036067 closed markmm82 old callouts should be refactored to implement SimpleCallout 
diff 36559.diff (47,853) 2017-08-01 10:00
https://issues.openbravo.com/file_download.php?file_id=10938&type=bug
Issue History
2017-08-01 09:02aferrazNew Issue
2017-08-01 09:02aferrazAssigned To => platform
2017-08-01 09:02aferrazModules => Core
2017-08-01 09:02aferrazTriggers an Emergency Pack => No
2017-08-01 09:03aferrazRelationship addedrelated to 0036067
2017-08-01 10:00aferrazFile Added: 36559.diff
2017-08-04 09:41alostaleRelationship addeddepends on 0036599
2017-08-04 09:44hgbotCheckin
2017-08-04 09:44hgbotNote Added: 0098384
2017-08-04 09:44hgbotStatusnew => resolved
2017-08-04 09:44hgbotResolutionopen => fixed
2017-08-04 09:44hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b12d3da979dfb34ae678e7033cb0c4af8ec93398 [^]
2017-08-04 09:46alostaleAssigned Toplatform => alostale
2017-08-04 09:47alostaleReview Assigned To => alostale
2017-08-04 09:47alostaleNote Added: 0098386
2017-08-04 09:47alostaleStatusresolved => closed
2017-08-04 09:47alostaleFixed in Version => 3.0PR17Q4
2017-09-18 18:23caristuRelationship addedrelated to 0036882

Notes
(0098384)
hgbot   
2017-08-04 09:44   
Repository: erp/devel/pi
Changeset: b12d3da979dfb34ae678e7033cb0c4af8ec93398
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Aug 01 13:42:56 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b12d3da979dfb34ae678e7033cb0c4af8ec93398 [^]

fixed 36559: platform callouts should be refactored to implement SimpleCallout

---
M modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorFieldPropertyCallout.java
M src/org/openbravo/erpCommon/ad_callouts/Activation_Message.java
M src/org/openbravo/erpCommon/ad_callouts/SL_AlertRule_SQL.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Column.java
M src/org/openbravo/erpCommon/ad_callouts/SL_IsDefault.java
M src/org/openbravo/erpCommon/ad_callouts/SL_ModuleCallout.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Module_Minor_Version.java
M src/org/openbravo/erpCommon/ad_callouts/SL_TableAudit.java
---
(0098386)
alostale   
2017-08-04 09:47   
Reviewed proposed patch, applied with some modifications and tested