Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0012418 | Openbravo ERP | A. Platform | public | 2010-02-23 15:23 | 2022-02-01 08:08 | |||||||
Reporter | fcatrin | |||||||||||
Assigned To | Triage Platform Base | |||||||||||
Priority | high | Severity | major | Reproducibility | sometimes | |||||||
Status | acknowledged | Resolution | open | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | main | |||||||||||
Target Version | Fixed in Version | |||||||||||
Merge Request Status | ||||||||||||
Review Assigned To | ||||||||||||
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 | 0012418: Cached prepared statements consumes tons of memory | |||||||||||
Description | Each connection in the connection pool has a prepared statement cache. Current code uses an unlimited size for this cache through a StackKeyedObjectPoolFactory object. For each prepared statement in the cache there is an open cursor in the database Depending on how big the connection pool is, the application server dies with an out of memory error, or the database run out of cursors after a few days running. With only 15 connections in the pool, I detected almost 3000 open cursors in the database, and almost 1GB used only by prepared statements. I understand that we can assing high amounts of memory to the application server and thousands of open cursors in the database, but as I have checked, the objects retained in memory for the statement cache can go up to 1GB with 15 connections and less than 10 users. | |||||||||||
Steps To Reproduce | Configure a connection pool with 15 connections (bbdd.maxConns = 15). If you don't set max cursors to thousands in the database it will reach the limit in a few hours/days, if you set less than 1GB of ram the application server will throw an out of memory error after some hours/days. | |||||||||||
Proposed Solution | I wrote a patch in OpenbravoCore to add a new parameter: bbdd.maxStmts This parameter controls the prepared statement cache for each connection. Possible values are: -1 or unspecified : no limit. The actual behavior 0 : no cache at all n>0 : cache size n If the cache is not enough, it will grow temporally and then it will shrink again when the prepared statements get classified as unused for some time. | |||||||||||
Additional Information | ||||||||||||
Tags | Performance | |||||||||||
Relationships |
| |||||||||||
Attached Files | ob-maxStmtPool.patch (3,399) 2010-02-23 15:23 https://issues.openbravo.com/file_download.php?file_id=2271&type=bug | |||||||||||
Issue History | ||||||||||||
Date Modified | Username | Field | Change | |||||||||
2010-02-23 15:23 | fcatrin | New Issue | ||||||||||
2010-02-23 15:23 | fcatrin | Assigned To | => alostale | |||||||||
2010-02-23 15:23 | fcatrin | File Added: ob-maxStmtPool.patch | ||||||||||
2010-02-23 15:55 | fcatrin | Note Added: 0024752 | ||||||||||
2010-02-24 10:30 | pjuvara | Priority | normal => urgent | |||||||||
2010-03-01 10:34 | alostale | Status | new => scheduled | |||||||||
2010-03-01 10:34 | alostale | Assigned To | alostale => shuehner | |||||||||
2010-03-01 10:34 | alostale | fix_in_branch | => pi | |||||||||
2010-03-03 18:09 | shuehner | Note Added: 0025024 | ||||||||||
2010-03-03 20:04 | fcatrin | Note Added: 0025036 | ||||||||||
2010-04-16 16:05 | jpabloae | Issue Monitored: jpabloae | ||||||||||
2010-05-13 19:20 | iatienza | Issue Monitored: iatienza | ||||||||||
2011-10-28 20:37 | iciordia | Type | defect => design defect | |||||||||
2011-10-28 20:37 | iciordia | fix_in_branch | pi => | |||||||||
2011-10-28 20:37 | iciordia | Assigned To | shuehner => alostale | |||||||||
2012-04-13 10:51 | alostale | Tag Attached: Performance | ||||||||||
2012-04-27 11:47 | Xpand-IT | Issue Monitored: Xpand-IT | ||||||||||
2012-09-24 23:37 | AugustoMauch | Note Added: 0052503 | ||||||||||
2012-09-24 23:37 | AugustoMauch | Priority | urgent => high | |||||||||
2013-05-22 06:36 | eintelau | Issue Monitored: eintelau | ||||||||||
2014-03-18 15:51 | alostale | Relationship added | related to 0026030 | |||||||||
2014-03-18 15:52 | alostale | Triggers an Emergency Pack | => No | |||||||||
2014-03-18 15:52 | alostale | Target Version | => PR14Q3 | |||||||||
2014-06-25 16:15 | AugustoMauch | Target Version | PR14Q3 => PR14Q4 | |||||||||
2014-10-02 11:10 | alostale | Target Version | 3.0PR14Q4 => | |||||||||
2017-03-31 14:36 | alostale | Status | scheduled => acknowledged | |||||||||
2017-04-10 14:34 | alostale | Assigned To | alostale => platform | |||||||||
2022-02-01 08:08 | alostale | Assigned To | platform => Triage Platform Base |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|