commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raman Gupta (JIRA)" <>
Subject [jira] Created: (VFS-122) [vfs] Synchronization issue in SoftRefFilesCache
Date Wed, 04 Apr 2007 06:19:32 GMT
[vfs] Synchronization issue in SoftRefFilesCache

                 Key: VFS-122
             Project: Commons VFS
          Issue Type: Bug
    Affects Versions: 1.0
         Environment: Sun Solaris, JDK 1.5.0_08
            Reporter: Raman Gupta

I am using Commons VFS 1.0 RC8, and I believe I have found a
synchronization problem in My system
occasionally exhibits high CPU usage in a thread with the stack shown
below [1]. The problem method is a HashMap.put at line 155 -- though I
think the line number is actually 156, since 155 is a TreeMap.put.

Access to the refReverseMap is not synchronized (nor is the map itself
synchronized) which I believe is the problem. On multi-cpu machines,
this can cause race conditions in HashMap.

[1] Thread stack:

"Thread-28" prio=10 tid=0x00f56090 nid=0x34 runnable
        at java.util.HashMap.put(
        at org.apache.commons.vfs.cache.SoftRefFilesCache.putFile(
        - locked <0xb7a09558> (a java.util.TreeMap)
        at org.apache.commons.vfs.provider.AbstractFileSystem.putFileToCache(
        at org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(
        - locked <0xb791bfe8> (a org.apache.commons.vfs.provider.local.LocalFileSystem)
        at org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(
        - locked <0xb791bfe8> (a org.apache.commons.vfs.provider.local.LocalFileSystem)
        at org.apache.commons.vfs.provider.AbstractFileSystem.getRoot(
        at org.apache.commons.vfs.provider.AbstractFileObject.getParent(
        at org.apache.commons.vfs.provider.AbstractFileObject.isWriteable(
        at org.apache.commons.vfs.provider.AbstractFileObject.getOutputStream(
        at org.apache.commons.vfs.provider.DefaultFileContent.getOutputStream(
        at org.apache.commons.vfs.provider.DefaultFileContent.getOutputStream(

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message