On May 25, 2009, at 11:28 PM, Mario Ivankovits wrote:

Hi!

1. Is the LRUFilesCache safe for production use? GAE/J won't allow using the default SoftRefFilesCache because it doesn't allow background threads. I 've found a few really old messages saying things like "SoftRefFilesCache is the only implementation suitable for production use" and "other file
cache implementation might cause resouce leaks", etc.

Yes, these messages are still true. Sad to say that, but I realized that too late and planned to fix this, which is not that easy.

Using any thing else than the SoftRefFilesChache will introduce memory leaks as the file-system object will not be discarded. You have to call close() on the filesystem, or even better call close on the DefaultFileSystemManager at all and do not use the VFS.getManager() singleton approach. That will also ensure that each and every resource used by the underlaying libraries are closed then too.

Actually, I commented out the call to filesystemclose in SoftRelFilesCache. While looking at the FileSystem implementation I realized that the way close is implemented is not thread safe and can't be called while the system is running. I believe the fix for this is non-trivial.

Ralph


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to