Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0053918
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajorsometimes2023-11-13 13:222023-11-27 08:13
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in VersionPR24Q1
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0053918: BO utilization causes excessive JVM metaspace usage

DescriptionWhen backoffice application is intensively used, the JVM metaspace consumption considerably increases.

Javascript code is compiled in the JVM for OBBindings (ie. for filter selectors), causing this pressure in the metaspace.

Ie.: this command shows the number of currently loaded scripts, which can be huege: jcmd Bootstrap VM.metaspace show-classes show-loaders | grep org.mozilla.javascript.gen | wc -l
Steps To Reproduce#1. In a real customer

In real customers with BO intensive use, monitory metaspace:

jcmd Bootstrap VM.metaspace

Detected in some live customer having 30GB allocated for heap space, meta to be >5GB.

#2. Emulate it by executing this code

try {
  System.out.println("start.,,");
  long t = System.currentTimeMillis();
  for (int i = 0; i < 10000; i++) {
    ParameterUtils.getJSExpressionResult(Map.of("inpTableId", "333") //
        , null,
        "OB.getFilterExpression(\"org.openbravo.erpCommon.info.BusinessPartnerSelectorFilterExpression\")");
  }
  System.out.println("done " + (System.currentTimeMillis() - t));
} catch (ScriptException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
}
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0157102)
hgbot (developer)
2023-11-13 14:06

Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1048 [^]
(0157651)
hgbot (developer)
2023-11-27 08:13

Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/1048 [^]
(0157652)
hgbot (developer)
2023-11-27 08:13

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 80547cae41df0e44264e592fde6a106e6b4edde5
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 27-11-2023 06:44:42
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/80547cae41df0e44264e592fde6a106e6b4edde5 [^]

fixes BUG-53918: BO utilization causes excessive JVM metaspace usage

Backoffice uses OBBindings to compute defaults and filter expressions. They are
executed as JavaScript scripts. Each time one was used, it was compiled and
discarded causing a high usage of the mataspace.

Now they are cached (their key is the script string itself) so that each of them
is compiled just once.

---
M src-test/src/org/openbravo/test/expression/OBBindingsTest.java
M src/org/openbravo/base/expression/OBScriptEngine.java
---

- Issue History
Date Modified Username Field Change
2023-11-13 13:22 alostale New Issue
2023-11-13 13:22 alostale Assigned To => Triage Platform Base
2023-11-13 13:22 alostale Modules => Core
2023-11-13 13:22 alostale Triggers an Emergency Pack => No
2023-11-13 13:27 alostale Description Updated View Revisions
2023-11-13 13:27 alostale Steps to Reproduce Updated View Revisions
2023-11-13 13:50 alostale Description Updated View Revisions
2023-11-13 13:50 alostale Steps to Reproduce Updated View Revisions
2023-11-13 14:06 hgbot Note Added: 0157102
2023-11-13 14:26 shuehner Issue Monitored: shuehner
2023-11-14 07:39 alostale Steps to Reproduce Updated View Revisions
2023-11-14 07:39 alostale Assigned To Triage Platform Base => alostale
2023-11-27 08:13 hgbot Resolution open => fixed
2023-11-27 08:13 hgbot Status new => closed
2023-11-27 08:13 hgbot Note Added: 0157651
2023-11-27 08:13 hgbot Fixed in Version => PR24Q1
2023-11-27 08:13 hgbot Note Added: 0157652


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker