Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2068

PurgeInternal operation in Cassandra cache store might lead to out of memory

XMLWordPrintable

      I am using Infinispan on top of a Cassandra cache store. Whenever I start an Infinispan cluster node, and Cassandra contains data from a previous run, the application immediatly allocates all available memory (1GB) and after a few minutes I get OutOfMemory exceptions in org.infinispan.loaders.cassandra.CassandraCacheStore.purgeInternal.

      If I purge Cassandra manually (TRUNCATE InfinispanEntries; TRUNCATE InfinispanExpiration and restart the application, everything works again.

      Note that there were only around 10000 entries stored in Cassandra (around 150 MB spread over 2 nodes).

      Infinispan loaders configuration:

      <loaders passivation="false" preload="false" shared="true">
      <loader class="org.infinispan.loaders.cassandra.CassandraCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
      <properties>
      <!-- property name="autoCreateKeyspace" value="true"/ -->
      <property name="host" value="localhost" />
      <property name="keySpace" value="Infinispan" />
      <property name="entryColumnFamily" value="InfinispanEntries" />
      <property name="expirationColumnFamily" value="InfinispanExpiration" />
      <property name="sharedKeyspace" value="false" />
      <property name="readConsistencyLevel" value="ONE" />
      <property name="writeConsistencyLevel" value="ONE" />
      <property name="configurationPropertiesFile" value="cassandrapool.properties" />
      <property name="keyMapper" value="org.infinispan.loaders.keymappers.DefaultTwoWayKey2StringMapper" />
      </properties>
      </loader>
      </loaders>

      Stack trace:

      Caused by: java.lang.OutOfMemoryError: Java heap space
      at java.nio.ByteBuffer.wrap(ByteBuffer.java:367)
      at java.nio.ByteBuffer.wrap(ByteBuffer.java:390)
      at org.apache.thrift.TBaseHelper.rightSize(TBaseHelper.java:279)
      at org.apache.cassandra.thrift.Column.getName(Column.java:195)
      at org.infinispan.loaders.cassandra.CassandraCacheStore.purgeInternal(CassandraCacheStore.java:539)
      at org.infinispan.loaders.cassandra.CassandraCacheStore.start(CassandraCacheStore.java:153)
      at org.infinispan.loaders.CacheLoaderManagerImpl.start(CacheLoaderManagerImpl.java:136)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:236)
      at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:885)
      at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:639)
      at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:628)
      at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:531)
      at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:174)
      at org.infinispan.CacheImpl.start(CacheImpl.java:521)
      at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:656)
      at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:549)
      at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:521)

              ttarrant@redhat.com Tristan Tarrant
              gmels Giovanni Mels (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: