Today I have faced a problem connected to the categoryCombos as suddenly all my dataSets stopped to show for all users, except superuser, on the drop-down list.
I have checked all sharing options nothing changed.
So then I have decided to run maintenance-app and recreate the category option combinations.
Have received an error: HTTP Status 500 – Internal Server Error, which was linked to Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: Java heap space but still getting the same error.
The interesting part is that the list of dataSets available and visible on DataSet report app.
Thanks for all the information! Could this be related to the setup of the instance as a whole? I mean since it mentions the “OutOfMemory” error, it might needs some sort of debugging to how the database is running and configured.
As I understand from you post, nothing in the instance nor the metadata configuration and sharing access changed internally, so it’s possible that this needs to get a closer look into the infrastructure?
I think you’re running into a Java heap space OutOfMemoryError while trying to recreate category option combinations in your DHIS2 instance. From the data you have provided, 1470 category options, 253 categories, and 256 category combinations, I understand that the memory consumption during this operation can be quite significant, that too if many combinations need to be regenerated at once.
Although your Tomcat is configured with 16GB of maximum heap (-Xmx16384m), the error suggests that either the operation is too memory-intensive for a single run or there may be a memory leak or inefficient handling of large collections during this maintenance task.
I will give a few suggestions to check and fix this:
You can try to increase Tomcat’s Metaspace size by adding something like -XX:MaxMetaspaceSize=512m if not already set. This can sometimes impact application stability while performing large operations.
Switching to the G1GC garbage collector if still on the default one. This can be done by adding -XX:+UseG1GC. This G1GC garbage collector actually handles large heaps better and reduces long GC pauses. So this might help.
If possible, break down the maintenance task. Instead of regenerating all combinations at once, you can consider processing them in smaller batches or even consider disabling unused categories. This will definitely reduce the load.
Review your DHIS2 version. Since you’re on 2.36.6, Please check if there are known memory-related issues in the maintenance app for this version. Upgrading to a newer maintenance patch might help.
Monitor heap usage live during this operation using tools like VisualVM or jconsole to identify if any objects or processes are holding excessive memory.
I also feel that you are going through a permission caching issue as well. While your dataSets aren’t showing for normal users, but are visible to superusers and still appear in reports, it hints at a possible permission caching issue. You should try clearing the application cache or restarting after adjustments might help too.
All these suggested steps will help you with stabilizing the system and will help you avoid repeated OutOfMemoryErrors during heavy operations.