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

remote diskcache, out of memory and lost objects using remoting

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Blocker
    • Resolution: Invalid
    • jcs-1.3
    • jcs-1.3
    • RMI Remote Cache
    • None
    • java6, xp, tomcat6

    Description

      I try to put and get objects from a remote cache, that is running on Tomcat. I use index_disk_cache on the server. The communication between client and server works. In case of large objects or a large number of objects I get a java.lang.OutOfMemoryError

      Exception in thread "CacheEventQueue.QProcessor-myRegion1" java.lang.OutOfMemoryError: Java heap space
      at sun.reflect.ByteVectorImpl.trim(ByteVectorImpl.java:52)
      at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:370)
      at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:95)
      at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:313)
      at java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1327)
      at java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:52)
      at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:437)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:413)
      at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1106)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
      at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:274)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
      at org.apache.jcs.auxiliary.remote.server.RemoteCacheServer_Stub.update(Unknown Source)
      at org.apache.jcs.auxiliary.remote.RemoteCache.update(RemoteCache.java:210)
      at org.apache.jcs.engine.CacheAdaptor.handlePut(CacheAdaptor.java:91)
      at org.apache.jcs.engine.CacheEventQueue$PutEvent.doRun(CacheEventQueue.java:688)
      at org.apache.jcs.engine.CacheEventQueue$AbstractCacheEvent.run(CacheEventQueue.java:607)
      at org.apache.jcs.engine.CacheEventQueue$QProcessor.run(CacheEventQueue.java:575)

      My configurations are:

      1) client:

      jcs.auxiliary.RFailover=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
      jcs.auxiliary.RFailover.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
      jcs.auxiliary.RFailover.attributes.FailoverServers=pchl:1102
      jcs.auxiliary.RC.attributes.RemoveUponRemotePut=true
      jcs.auxiliary.RFailover.attributes.GetOnly=false
      jcs.auxiliary.RFailover.attributes.MaxObjects=100
      jcs.region.myRegion1=RFailover

      #jcs.region.myRegion1=RFailover
      #jcs.region.myRegion1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
      #jcs.region.myRegion1.cacheattributes.MaxObjects=100
      #jcs.region.myRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache

      Server:

      1. Remote RMI Cache set up to failover
        jcs.auxiliary.RFailover=org.apache.jcs.auxiliary.remote.RemoteCacheFactory
        jcs.auxiliary.RFailover.attributes=org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
        jcs.auxiliary.RC.attributes.RemoveUponRemotePut=true
        jcs.auxiliary.RFailover.attributes.GetOnly=false
      1. this didn't help, the memory error occurs with and without
        #jcs.region.testCache1=DC,RFailover
        #jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
        #jcs.region.testCache1.cacheattributes.MaxObjects=1000
        #jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
      1. Registry used to register and provide the
      2. IRemoteCacheService service.
        registry.host=localhost
        registry.port=1102
      3. call back port to local caches.
        remote.cache.service.port=1102
      4. cluster setting
        remote.cluster.LocalClusterConsistency=true
        remote.cluster.AllowClusterGet=true

      ##############################################################

              1. Default Region Configuration
                jcs.default=DC
                jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
                jcs.default.cacheattributes.MaxObjects=100
                jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
                jcs.default.cacheattributes.UseMemoryShrinker=false
                jcs.default.cacheattributes.ShrinkerIntervalSeconds=60

      ##############################################################

              1. CACHE REGIONS
                jcs.region.myRegion1=DC
                jcs.region.myRegion1.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
                jcs.region.myRegion1.cacheattributes.MaxObjects=-1
                jcs.region.myRegion1.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
                #jcs.region.myRegion1.cacheattributes.DiskUsagePattern=SWAP
                ##############################################################
              2. AUXILIARY CACHES
      1. Indexed Disk Cache
        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=O:
        liantis/JCS/dump
        jcs.auxiliary.DC.attributes.DiskPath=dump
        jcs.auxiliary.DC.attributes.MaxPurgatorySize=100
        jcs.auxiliary.DC.attributes.MaxKeySize=-1
        jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=300000
        jcs.auxiliary.DC.attributes.OptimizeOnShutdown=true
        jcs.auxiliary.DC.attributes.MaxRecycleBinSize=7500
        jcs.auxiliary.DC.attributes.EventQueueType=POOLED
        jcs.auxiliary.DC.attributes.EventQueuePoolName=disk_cache_event_queue
      1. Disk Cache pool
        thread_pool.disk_cache_event_queue.boundarySize=50
        thread_pool.disk_cache_event_queue.useBoundary=true
        thread_pool.disk_cache_event_queue.maximumPoolSize=15
        thread_pool.disk_cache_event_queue.minimumPoolSize=1
        thread_pool.disk_cache_event_queue.keepAliveTime=3500
        thread_pool.disk_cache_event_queue.startUpSize=1

      pchl is the server on that Tomcat is running.

      In case of smal objects I have the problem, that I will lose objects again. I've configured the queue and the threadpool at the server, but it seams, that there is something too, that I've forgotten...

      I'll work with a absolute minimum on java heapsize, that is the reson to use a cache in our case.

      The problems will occur with and without the outcommented lines in the clientconfiguration

      The reason for the questions during the last days are , that we evaluate caching architectures and performance using jcs ...

      Attachments

        Activity

          People

            asmuts Aaron Smuts
            mquasten Manfred Quasten
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: