When running a check-in/out test with the Juniper release for 30 minutes, the database consumes memory aggressively. Depending on the load, the DB could use up anywhere from 800MB (1 user) to 2GB of memory (20 users). Running the test for more than 3 hours would exhaust all the available memory that the DB started out with, 7GB. Investigate the cause of this aggressive memory consumption.
Steps to Reproduce A:
Run the check-in/out test for 30 minutes with at least 5 concurrent users and observe the DB's memory usage pattern in Cloudwatch
Expected Results A:
Memory consumption would be steady and does not drop much more as long as it has claimed enough memory for the current load.
Actual Results A:
Memory keeps on being claimed but not returned during the test duration.
Steps to reproduce B:
Build and run mod-configuration 5.7.0 jar:
POST /_/tenant to create schema for diku and run GET requests against the empty configuration table:
There is no record and each GET returns an empty set.
Run pg_top (or ps -F ax) to watch the memory consumption of the database process of the connections of mod-configuration.
Expected result B:
The database memory usage stays below 20 MB per connection.
Actual result B:
The database memory usage for one of the four mod-configuration connections increases by 90 MB per minute.
See https://wiki.folio.org/pages/viewpage.action?pageId=65116448 for more details.
The memory issue is caused by RMB's streamGet that doesn't close PreparedStatement after use. The bug has been introduced by https://github.com/folio-org/raml-module-builder/commit/d38030b9d8929b0d497bd48167fffd05c560bc10 and is in RMB >= 33.0.0.
streamGet is used by only 4 modules (GitHub search):
After RMB has been released with this fix these 4 modules should upgrade RMB and release a new version.
|Juniper w/o fix (HotFix#2)||Juniper with fix (HotFix#3)||Kiwi w/o fix||Kiwi with fix|