Question

From analyzing the heap usage and the number of objects created, I believe this is what's causing my program to have huge memory usage and causing it to run slower than expected.

How can I determine what is causing this high memory usage and pinpoint which bit of the code is actually causing it.

I've used Plumbr to try and identify any memory leaks and they say there is none.

Here is an image of the heap usage and objects used.

Heap and tracked objects

Was it helpful?

Solution

If your code frequently allocates new objects the garbage collection might run very often slowing down your program. I'm using JProfiler in the office to track down this kind of problem. It tells you how many objects of a certain class are allocated and makes it ease to find allocation hotspots. This is a commercial software but i believe they have a trail.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top