From: Emeric V. <ev...@fr...> - 2011-09-03 21:00:49
|
Hi, I have some questions on JRobin current sources : 1. I would like to submit a patch for the static final Timer in RrdNioBackendFactory. This timer can be considered as a memory problem in application servers, because it creates a thread and it can't be stopped when the application is undeployed, for example when a webapp including jrobin is redeployed in Tomcat after a class change. The problem is that the thread is not stopped and that a lot of classes in the ClassLoader can't be unloaded (OutOfMemoryError PermGen space). Tomcat 7 and recent Tomcat 6 logs the thread as a warning when the webapp is undeployed. Currently, there is no reliable way to work around that, given that the timer is final. I think that a simple way to fix this would be to add the following method in the RrdNioBackend class. public static void setFileSyncTimer(Timer newFileSyncTimer) { fileSyncTimer.cancel(); fileSyncTimer = newFileSyncTimer; } The webapp will be able to give at initialization its own timer, which be cancellable when the webapp is undeployed. A second method can also be added (but it will not be enough without the "setTimer" method in some application servers like WebLogic) : public static Timer getFileSyncTimer() { return fileSyncTimer; } What do you think of this? 2. Is there a reason for the recent change of the default backend factory from "NIO" to "FILE" in RrdBackendFactory.selectDefaultFactory() ? This was committed in the same commit as the one adding the new RrdNioByteBufferBackendFactory, after the 1.5.9 release. 3. What is RrdNioByteBufferBackendFactory good for, compared to RrdNioBackendFactory? Do you recommend it other RrdNioBackendFactory? I have not found information in javadoc. Thanks, Emeric |