Memory Leak related issues

Good day All,

we came accross this issue, and has been troubling us for about 2 weeks now.
we are busy setting up new dhis2 production, training and staging instances, but one instance is having an issue… every step goes through well, but when we start the container, it throws us with this errors below;

[crit] The web application [staging-idsr] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@77b64428]) and a value of type [org.hibernate.boot.internal.MetadataImpl] (value [org.hibernate.boot.internal.MetadataImpl@5f9ffee]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

dhis2 version = 2.30
heap memory =8GB

on the web interface it just shows this error:

HTTP Status 404 – Not Found

Hi @joneslikoro

Would you be able to share more info about the infrastructure and environment this instances is working on? How much memory is it allocated? What versions of Tomcat, Java, and Postgresql? What’s the Java heap space set to?

Hi @Gassim,
Thanks for that.

Tomcat version = 9
Java version = 1.8.0_382
PostgreSQL =13.11
Ubuntu = 22.04
Container = LXD
Java Heap memory = 8GB
DHIS2 version = 2.30

Hello Mr. Likoro.
I trust you are doing fine. Could you please give us more insights on the resources you have on your staging environment ?.
and are you on an empty database ?.

1 Like

Thank you Mr. Tito.
the memory leak warnings actually starts immediately after you finish the setup, so its on the blank db, but the tomcat can not run because of the possible memory leak.

Hi Jones. The memory leak is a bit of a distraction here from the real problem. It is just the result of an unclean shutdown. The real cause of the startup problem will be higher up in the log file.

Hi all, you may close the issue. we managed to walkaround it.
we, installed version 2.35 and java “11”.

1 Like

Hi @joneslikoro

That’s good news, so maybe the issue was with the versions; however, using 2.35 doesn’t seem like a good solution because on the contrary, it’s recommended to use one of the latest supported versions. Currently, the supported versions are 2.37 and above. I’d still recommend testing with one of the latest versions.


Hello @joneslikoro

I hope this message finds you well. We are continuing to explore the issues you raised, and we strongly believe that delving into the logs will provide us with valuable insights. Understanding the intricacies of the situation will not only benefit the current scenario but also contribute to our knowledge base, preventing similar occurrences for others.

Considering the complexity of such matters, we do not wish to assume that transitioning to version 2.35 will be a definitive solution for others who may encounter similar challenges. Your insights are invaluable in addressing the root cause comprehensively.

We remain optimistic that you can provide additional information to further illuminate the nature of this problem.

Thank you for your cooperation.

Best regards,