Analysing Java memory usage

0
We currently have an environment that runs at close to max usage of it’s 1gb memory and instead of adding more memory, we are looking to try and optimise the system – there’s definitely room for improvement! The problem is the system is huge and we’re unsure where to start. What I’d like to be able to do is run some diagnostics and find where all the memory is being used up, on which page loads or in which microflows. Are there any tools that can help me do this? Whether it’s a Mendix tool or something else that can help, anything would be great! Also, has there been any noticable increase in memory usage with the newer Mendix versions? Or has it been improving, even? Cheers.
asked
2 answers
0

The question you are asking is very broad and answer is subjective to the app and causes of issue.

This topic has been discussed multiple times in the forum. 

Please check in the old forum topics for suggestions. 

But to start with I could suggest the following

  1. Jvisualvm → this comes out of the box with java
  2. Eclipse Memory analyzer

 

Both of the above tools help you with heap dumps analysis.

 

answered
0

It's actually a great move to optimize memory usage before scaling up hardware that too in complex systems where inefficiencies can quietly consume resources.  In your case — with a Java-based environment running near its 1 GB memory limit. So, the first and foremost step is basically to identify the parts of the system that are holding any unnecessary memory. To do this you can use several free available tools like HeapHero, VisualVM or Eclipse Memory Analyzer (MAT) and so and so....

 

Now, coming to your question on Mendix -what i will say is in general the memory usage trends depend on your app’s design, module upgrades, and runtime behavior. Some newer Mendix versions have improved memory management, but it’s common for memory consumption to increase if applications grow in complexity without optimization. It’s worth reviewing release notes and community feedback specific to your version.

Your next steps could be:

  • Attaching VisualVM or JConsole to your running app to watch live memory usage and identify which operations cause memory spikes.
  • Capturing heap dumps during peak memory usage and analyze them with MAT or HeapHero.
  • Reviewing your app’s microflows and page loads associated with those spikes for optimization opportunities, such as reducing unnecessary object retention, clearing caches, or refactoring inefficient flows.

Optimizing memory is an iterative process, but these tools can give you a clear, data-driven place to start. For a helpful guide on detecting subtle memory leaks and unnecessary object retention during your analysis, check out this blog: Beyond OutOfMemoryError: Using a Memory Analyzer for Subtle Memory Leaks

answered