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

not able to deallocate the disk memory

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • jcs-1.3
    • jcs-1.3
    • Indexed Disk Cache
    • None
    • Windows Xp,RAD,java5,AMD processor

    Description

      I have configured the JCS to store the cached objects in disk using below properties.

      jcs.region.report.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
      jcs.region.report.cacheattributes.MaxObjects=2
      jcs.region.report.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
      jcs.region.report.cacheattributes.UseMemoryShrinker=true
      jcs.region.report.elementattributes.MaxLifeSeconds=60
      jcs.region.testCache1.cacheattributes.MaxMemoryIdleTimeSeconds=60
      jcs.region.report.cacheattributes.ShrinkerIntervalSeconds=10
      jcs.region.report.cacheattributes.MaxSpoolPerRun=300
      jcs.region.report.elementattributes=org.apache.jcs.engine.ElementAttributes
      jcs.region.report.elementattributes.IsEternal=false

      jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
      jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
      jcs.auxiliary.DC.attributes.DiskPath=c:/tempcache
      jcs.auxiliary.DC.attributes.ClearDiskOnStartup=true
      jcs.auxiliary.DC.attributes.maxKeySize=100000

      I tried to cache 100 objects. JCS cached the first 2 objects in the java memory as I specified jcs.region.report.cacheattributes.MaxObjects=2. The remaining objects gets cached in the disk file in c:/tempcache/report.data. After 60 (MaxLifeSeconds) seconds the objects stored in java memory got deleted. I am able to identify this by looking at the log file, it has log message like "Exceeded maxLifeSeconds: key name".

      I could not see above log message for the cached objects in disk after 60 seconds. I believe that objects stored on disk never get deleted but the surprise thing is if i try to access the cached object in disk after 60 seconds, it is returning null, that means the object has expired. But JCS is not deallocating the memory occupied by that expired object.
      Is it possible to deallocate that memory occupied when the object gets expired? I thought of asking this as I need to cache lot of data. If I am not able to deallocate the memory , the file size gets increased and might get exception.

      Attachments

        Activity

          People

            asmuts Aaron Smuts
            rushikumar rushi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: