Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020261Openbravo ERPA. Platformpublic2012-04-13 09:292012-05-17 09:21
alostale 
alostale 
immediatecriticalalways
closedfixed 
5
 
3.0MP113.0MP11 
Core
No
0020261: SessionInfo PreparedStatement is not closed
When there is at least one table fully audited, on each request a temporary table (ad_context_info) is populated with context information. The PreparedStatement used for this population is never closed.

This causes a memory leak in JVM as well as DB not releasing resources (open cursors in Oracle) making the application to degrade over time.

See attached a screenshot of memory consumption just after GC having 6 concurrent sessions during ~10min with a session ping of 500ms to simulate long usage. Second screenshot is taken in the same conditions after applying the fix. Both are taken in an instance using Oracle.
-In a professional instance, set at last one table to be fully audited
-Follow steps defined in issue 0020146
Performance
related to defect 00201463.0MP10 closed alostale AlertActionHandler PreparedStatement is not closed 
depends on backport 0020533 closed alostale SessionInfo PreparedStatement is not closed 
png audit-ps-not-fixed.png (39,685) 2012-04-13 09:37
https://issues.openbravo.com/file_download.php?file_id=5130&type=bug
png

png audit-ps-fixed.png (39,961) 2012-04-13 09:37
https://issues.openbravo.com/file_download.php?file_id=5131&type=bug
png
Issue History
2012-04-13 09:29alostaleNew Issue
2012-04-13 09:29alostaleAssigned To => alostale
2012-04-13 09:29alostaleModules => Core
2012-04-13 09:29alostaleRelationship addeddepends on 0020146
2012-04-13 09:29alostaleRelationship replacedrelated to 0020146
2012-04-13 09:30alostaleTag Attached: Performance
2012-04-13 09:37alostaleFile Added: audit-ps-not-fixed.png
2012-04-13 09:37alostaleFile Added: audit-ps-fixed.png
2012-04-13 09:40alostaleDescription Updatedbug_revision_view_page.php?rev_id=3359#r3359
2012-04-13 09:44alostaleTarget Version => 3.0MP11
2012-04-13 09:44alostaleDescription Updatedbug_revision_view_page.php?rev_id=3360#r3360
2012-04-13 10:58alostaleNote Added: 0047557
2012-04-13 10:59hgbotCheckin
2012-04-13 10:59hgbotNote Added: 0047558
2012-04-13 10:59hgbotStatusnew => resolved
2012-04-13 10:59hgbotResolutionopen => fixed
2012-04-13 10:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/5dd00d37616387fda77cdc81862a423de3d8bce3 [^]
2012-04-17 05:32hudsonbotCheckin
2012-04-17 05:32hudsonbotNote Added: 0047649
2012-04-26 15:47AugustoMauchNote Added: 0048039
2012-04-26 15:47AugustoMauchStatusresolved => closed
2012-04-26 15:47AugustoMauchFixed in Version => 3.0MP11
2012-05-17 09:20alostaleStatusclosed => new
2012-05-17 09:20alostaleResolutionfixed => open
2012-05-17 09:20alostaleFixed in Version3.0MP11 =>
2012-05-17 09:20alostaleStatusnew => scheduled
2012-05-17 09:20alostalefix_in_branch => pi
2012-05-17 09:20alostaleStatusscheduled => resolved
2012-05-17 09:20alostaleFixed in Version => 3.0MP11
2012-05-17 09:20alostaleResolutionopen => fixed
2012-05-17 09:21alostaleStatusresolved => closed

Notes
(0047557)
alostale   
2012-04-13 10:58   
Fix is not risky: it just closes prepared statements in SessionInfo.

Test plan:
-Check both in PG and ORA:
 *Follow steps to reproduce and check in Oracle (where it is more noticeable) cursors and memory consumption are not increasing.
 *Check audit trail still works: do modifications in records of audited tables and check they are audited.
(0047558)
hgbot   
2012-04-13 10:59   
Repository: erp/devel/pi
Changeset: 5dd00d37616387fda77cdc81862a423de3d8bce3
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Apr 13 10:54:41 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/5dd00d37616387fda77cdc81862a423de3d8bce3 [^]

fixed bug 20261: SessionInfo PreparedStatement is not closed

---
M src-core/src/org/openbravo/database/SessionInfo.java
---
(0047649)
hudsonbot   
2012-04-17 05:32   
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/cedf57621434 [^]

Maturity status: Test
(0048039)
AugustoMauch   
2012-04-26 15:47   
Code reviewed and verified in pi@153cac4dbab2