Valath
Valath

Reputation: 920

OOM error:Mule 3.7 community standalone, object to json transformer is shown in the leak suspect

Mule app using 3.7 community standalone version has crashed due to Out Of Memory issue. Analysing the heap dump, suspect looks to be one of the transformer widely used in code. Out of the box "Object to Json" transformer is being reported in the "leak suspect" with over 10k object references during the crash holding ~90% of heap.

Reading about the scope of transformers in Mule doc, transformers have prototype scope and its being cached/pooled, but not definitely a singleton.

From Mule 4 recommendation is to use DataWeave instead of transformers which has the capability to swap payload to file(off-heap) if not able to accommodate in memory.

Is the only possible solution is to benchmark the app with peak load and adjust JVM heap settings? I do not find any config which can control the indefinite growth of transformer object. Please give some guidelines if anyone experienced the same issue as am not a mule expert.

Upvotes: 0

Views: 127

Answers (1)

aled
aled

Reputation: 25837

Increasing the heap is only useful when the application requires more memory than assigned. If it is leaking memory it usually gets to the point that no heap is enough, though in some cases it could be useful to mitigate partially. For example if you can make it crash every few days instead of every hour. But it is not a full solution and might not work at all.

The thing is memory leaks depends on several factors. Many times complex to troubleshoot and require a lot of information, including several heap dumps, logs, access to the application, some understanding of how the application is implemented, and in this case the Mule runtime too, and many other factors. In a few cases it could be easy to identify the cause and the fix.

In this case you haven't provided enough information to start a full troubleshooting. A Stackoverflow question is not adequate for this kind of activity either.

I can however tell you the following advice:

  • You are using a very old version of Mule that is not even supported in its Enterprise Edition. Mule 3.7.0 was released around 2015.
  • Community editions lack patches. 3.7 has a lot of known issues that were patched in later releases and versions, including some major security vulnerabilities reported over the years.
  • There was a possible leak related to what you described reported against Mule 3.7. Because of the previous points you would need to upgrade to have it patched.

My recommendation is to test and migrate to Mule 3.9, where at least some issues. If possible skip Mule 3 completely and migrate directly to the latest Mule 4 available, however that will require a rewrite of the application. There is a community tool called Mule Migration Assistant that you can use to help starting the migration to Mule 4.

Even if you stay in Mule 3.7 migrating the transformation to DataWeave may resolve the issue since it has a different implementation. Having said that Mule 3 Community Editions don't support DataWeave so it would not be useful for your installation.

Upvotes: 1

Related Questions