Uploaded image for project: 'Commons JCS'
  1. Commons JCS
  2. JCS-156

BlockDiskCache is limited to 2GB.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Incomplete
    • Affects Version/s: jcs-2.0-beta-1
    • Fix Version/s: jcs-2.0-beta-2
    • Component/s: Composite Cache
    • Labels:
      None

      Description

      There is a bug in BlockDiskCache which makes it limited to 2GB in size. If I try to write more, I'm getting the following exception:

      Exception in thread "CacheEventQueue.QProcessor-sliderCache" java.lang.IllegalArgumentException: Negative position
      at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:754)
      at org.apache.commons.jcs.auxiliary.disk.block.BlockDisk.write(BlockDisk.java:216)
      at org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCache.processUpdate(BlockDiskCache.java:394)
      at org.apache.commons.jcs.auxiliary.AbstractAuxiliaryCacheEventLogging.updateWithEventLogging(AbstractAuxiliaryCacheEventLogging.java:65)
      at org.apache.commons.jcs.auxiliary.disk.AbstractDiskCache.doUpdate(AbstractDiskCache.java:804)
      at org.apache.commons.jcs.auxiliary.disk.AbstractDiskCache$MyCacheListener.handlePut(AbstractDiskCache.java:662)
      at org.apache.commons.jcs.engine.AbstractCacheEventQueue$PutEvent.doRun(AbstractCacheEventQueue.java:350)
      at org.apache.commons.jcs.engine.AbstractCacheEventQueue$AbstractCacheEvent.run(AbstractCacheEventQueue.java:269)
      at org.apache.commons.jcs.engine.CacheEventQueue$QProcessor.run(CacheEventQueue.java:304)

      The reason is that method calculateByteOffsetForBlock in BlockDisk class returns int instead of long.

        Attachments

        1. BlockDisk-calculateByteOffsetPatch.patch
          2 kB
          Wiktor N
        2. jcs.patch
          0.9 kB
          Ryan Fong

          Activity

            People

            • Assignee:
              tv Thomas Vandahl
              Reporter:
              anmalysh Alexander Malyshev
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: