BG crashes with OutOfMemory error on database metadata requested by portfolio sync accumulating in jdbc statement pool

Document ID : KB000103395
Last Modified Date : 26/06/2018
Show Technical Document Details
Issue:
The BG service crashes with Java OutOfMemory error. When reviewing the heap dumps we can see:
Multiple thousands rows accumulated for:
OQL: select * from java.lang.String s where s.toString() like "SELECT null AS TABLE_CAT,.*"
 
 
Synchronize Portfolio Investments job makes calls to get the database metadata from the DBMS through the driver. Unless this metadata is changed during runtime, the data should be cached and reused.
 
Instead, each run of the job repeats the same activity. When there are a lot of database connections in the pool due to normal usage (processes, gel scripts, background jobs) and then a large number of portfolios are scheduled to be synchronized, the potential for different connections to repeat this same effort (due to round-robin style use of the connections) increases further.
 
Progress DataDirect drivers implement "statement pooling" as a client-side optimization. This can result in a large accumulation of the same statements in separate connections of the pool. Observations include 150-400 statement references per connection, >15k total for the connection pool, and then ultimately causing a BG crash due to java.lang.OutOfMemoryError
 
Cause:
Caused by DE36817
Fixes available in: 15.2.0.7, 15.3.0.3, 15.4.0
 
Resolution:
Workaround: Schedule a periodic BG service restart (i.e. one weekly) or upgrade to a version in which the defect DE36817 is resolved.