commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <joerg.schai...@gmx.de>
Subject [vfs] VFS.getManager and FileCache
Date Thu, 06 Aug 2009 09:07:28 GMT
Hi gang,

the docs of VFS praise VFS.getManager() as simplest possibility to work with
VFS. However, this setup uses a SortRefFileCache as default implementation.
This caused our server app to fail, since it means that FileObject
instances are only garbage collected if the Java process runs out of
memory. However, if the instance refer some other limited resource (in our
case for SFTP socket connections to the SFTP server) they may never be
released. Our SFTP server simply runs out of available connections over
time.

Therefore we should possibly reconsider the default choice and use the
WeakRefFileCache instead. Since the FileObject instances are often linked
anyway with their parent/children references, the weak references are
normally not freed while the client has one reference left.

IMHO this behaviour matches the "simplest" (and less error-prone) approach
using VFS.getManager() most. WDYT?

- Jörg


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


Mime
View raw message