[ 
https://issues.apache.org/jira/browse/VFS-594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15133118#comment-15133118
 ] 

Sam Halliday commented on VFS-594:
----------------------------------

also, I'm now running this after I finish using each jar file (2.0)

      def nuke(jar: FileObject) = {
        jar.close()
        vfs.getFilesCache.removeFile(jar.getFileSystem, jar.getName)
    }

but I'm still seeing live references to the jar: from a YourKit references 
analyis of a strongly reachable object. So how do I really remove things from 
the refReverseMap ?

"Name","Retained Size","Shallow Size","Level"
"java.util.jar.JarFile name = 
""C:\Users\ENSIME\AppData\Local\Temp\1454615462378-0\testing\simpleJar\target\scala-2.11\testingsimplejar_2.11-0.9.10-SNAPSHOT.jar""","144","56","1"
"zipFile of org.apache.commons.vfs2.provider.jar.JarFileSystem","1464","72","2"
"fileSystem of org.apache.commons.vfs2.cache.FileSystemAndNameKey","24","24","3"
"value of java.util.HashMap$Entry chunk size = 1","56","32","4"
"[4356] of java.util.HashMap$Entry[16384]","747800","65552","5"
"table of java.util.HashMap size = 12183","747848","48","6"
"refReverseMap of 
org.apache.commons.vfs2.cache.SoftRefFilesCache","1730592","48","7"
"filesCache of 
org.apache.commons.vfs2.impl.StandardFileSystemManager","1737360","96","8"
"vfs of org.ensime.core.RichPresentationCompiler [Stack 
Local]","12024160","2080","9"
"compiler of scala.tools.nsc.interactive.PresentationCompilerThread [Thread, 
Stack Local]  ""Scala Presentation Compiler []""","1264","120","10"


> cache holds onto ZipFiles, which leak file handlers
> ---------------------------------------------------
>
>                 Key: VFS-594
>                 URL: https://issues.apache.org/jira/browse/VFS-594
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Sam Halliday
>
> The wonderful Java implementation of ZipFile opens up the file on instance 
> creation. That's exceptionally wasteful on Linux but downright buggy on 
> Windows, because Windows will then obtain an exclusive lock on that file.
> In ENSIME, this has the wonderful side effect of making compilation silently 
> fail, because the compiler can't write out to the jar file, because it's 
> being held by the IDE process.
> The references are being kept alive by the VFS cache. I'm going to try to 
> disable it, as well as attempt as much manual closing of ZipFiles as I 
> possibly can.
> Tracking from https://github.com/ensime/ensime-server/issues/1276



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to