javamemory-leaksrmijmx

JMX RMI - Memory Leak - ArrayNotificationBuffer getting bigger over time


i'm writing an application that should run many hours (10-100) which i'm monitoring using JMX.

However, after some time, i discover two things:

I'm thinking, that it has something to do with different connections to the application, but currently i'm just connected once, but some connections still seem to be open.

How can that be? How can i fix this?


Solution

  • I was poking around in the source code comments for ArrayNotificationBuffer and it has a decent amount of JMX trace logging, so you might want to enable JMX tracing to get a better idea of what's going on.

    You may find that this known bug is affecting you. The bug report indicates the issue is observed on long lasting connections. There's a couple of work-arounds mentioned, although a simpler one is not, if practical to you, which is to periodically disconnect and reconnect. The good news is that there appears to be a patch for this in Java7, although I'm not sure if it has reached a released build yet.

    I would also make sure that if you are registering JMX notification listeners, that they are continually and promptly handling notifications. Failure to do so might also be causing this symptom.