EntryProcessor invokeAll Thows OutOfMemory Exception for Large Caches (Doc ID 1298133.1)

Last updated on NOVEMBER 03, 2016

Applies to:

Oracle Coherence - Version: 3.5.0 to 3.6.1 - Release: AS10g to AS10g
Information in this document applies to any platform.

Symptoms

Call invokeAll() on a large cache (e.g. 20GB) from a client against all the entries in the cache. The entry processor returns null from the process() method. When the entry processor returns a Map of results the resulting Map contains every key in the cache as a key with null as the value. At a certain cache size the client will die with an "Out Of Memory" exception. This return Map must be buffered in the client even when there is no result.

The code being used is as follows.

....

        // this call will never complete - OOME Error because of the return map of keys overwhelms client
        cache.invokeAll(AlwaysFilter.INSTANCE, new Agent());

....

    /**
     * Do-nothing entry processor. Although this returns no data, a Map of key->null for
     * every key visited by the processor is returned to the client.
     */
    public static class Agent extends AbstractProcessor {
        private static final long serialVersionUID = 1L;

        @Override
        public Object process(Entry entry) {
            return null;
        }
    }

The run time error for the client is as follows.

2011-02-22 11:52:09.080/58.734 Oracle Coherence GE 3.6.1.0 <Error> (thread=DistributedCache, member=5): An exception (java.lang.OutOfMemoryError) occurred reading Message QueryResponse Type=74 for Service=PartitionedCache{Name=DistributedCache, State=(SERVICE_STARTED), LocalStorage=disabled}
2011-02-22 11:52:09.080/58.734 Oracle Coherence GE 3.6.1.0 <Error> (thread=DistributedCache, member=5): Terminating PartitionedCache due to unhandled exception: java.lang.OutOfMemoryError
2011-02-22 11:52:09.080/58.734 Oracle Coherence GE 3.6.1.0 <Error> (thread=DistributedCache, member=5):
java.lang.OutOfMemoryError: Java heap space
        at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2296)
        at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2254)
        at com.tangosol.io.DefaultSerializer.deserialize(DefaultSerializer.java:74)
        at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:1)

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms