1

I have a problem with my program (JSF running on Glassfish). It's proceeding a lot of data (and inserting it to the database using hibernate). And the problem is that after about 2 hours of work it slows down. I don't get any exception (especially there is no OutOfMemory). Is it possible that it is a memory leak? I've checked the heap dump with Eclipse Memory Analyzer and there were some HashMap issues. I've repaired it where it was possible and now the tool doesn't show this problem. But my application still doesn't work properly.

lotk
  • 384
  • 7
  • 20
  • you could try to connect to the vm using visualvm and have a look at the state of the VM, it might give some insight... –  Aug 08 '11 at 10:19
  • related/dupe: http://stackoverflow.com/questions/40119/how-to-find-a-java-memory-leak – amit Aug 08 '11 at 10:20

2 Answers2

3

It sounds like your problem is not a conventional memory leak at all.

If I was to guess, I'd say that you've got a poorly designed data structure, an ineffective cache, or maybe a concurrency bottleneck.

You should probably focus on performance profiling to see where the time is going and to look for signs of lock contention.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
0

There is a chance, that you have some sort of memory leak and produce a lot of temporary objects so that after a decent time the garbage collector kills your performance. If this is the case, you could play with the -Xmx option: with less heap size your application should slow down earlier, a bigger heap should show an oppisite effect.

The effect could also be caused by growing internal datastructures. Operations on datastructures always have a time complexity ("Big-O-Notation") and if the complexity is polynomal or even worse, such operations can kill performance too. Have a look at those collections in your applications that grow over time and double-check, that you've chose the optimal collection type.

Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268