We are currently doing performance test for Bahmni Lite in a dedicated performance environment. Further details on the setup and test scenarios could be found here.
When we started the performance test, we ran with default JAVA_OPTS(JVM) for OpenMRS
but we encountered the ‘Java Heap Size - Out of Memory’ issue intermittently as soon as we initiated the execution.
After discussion with community and various references for optimal JVM specs, we currently utilise the following JAVA_OPTS value
@raff we have completed the 70active users 8 hour performance test and observed the same issue again. We have captured the heap dump as you suggested and attached below for your reference.
So this is less a memory leak so much as too many things being held in memory in the FHIR module in particular. What happens is that when you make a request to search the FHIR module, if the returned results are larger than the configured page size, we store the results in a FIFO queue. This is because as part of the results, as required by the FHIR spec, we return next and previous links and if implementations follow those links, we need to be able to resume the results from where they left off. That queue for holding search results is growing to an absurd size (~2 GB) for two reasons:
We are allowing the FIFO queue to contain two many search results
The search results are stored as UUIDs. Looking through the heap dump, almost everything in the queue has on the order of 8k-12k results, almost entirely UUIDs for patients.
On the FHIR2 side, the quick-fix for this (which should be available momentarily in 1.8.0-SNAPSHOT) is just to severely ramp-down the number of results we allow to be queued. I’m also going to try to ensure that instead of storing UUIDs, we’re storing integers (i.e., the record ids), which should save quite a bit of space.
@ramkumar.g Are you able to re-run your tests with the 1.8.0-SNAPSHOT version of the FHIR2 module. If the fixes I’ve pushed solve this issue, I’ll release 1.8.0.
Hi @ibacher , Thanks for the 1.8.0 snapshot, we were able to perform various tests and found the memory consumption by FHIR services have been reduced to a great extent. Please plan your release for this version. Also any updates on the search results queue limitation feature for this module?
Hi @ibacher You mentioned a quick fix were we limit the number of results to be queued. Is this fix already available in 1.8.0-SNAPSHOT along with the integer update?