This page describes an older version of the product. The latest stable version is 16.4.

Off Heap RAM

When running with offheap blobstore enabled, you eliminate the JVM garbage collection influence since only part of your application data is stored into JVM Heap and most of the data is stored into off heap memory.

XAP is using MapDB, an embedded database engine which provides concurrent Maps, Sets and Queues backed by disk storage or off-heap memory. When writing an object to the space, its indexed data maintained on-heap and it’s raw data is stored on off-heap.

The indexes maintain in RAM (on-heap) allowing the XAP query engine to evaluate the query without accessing the raw data stored on off-heap. This allows XAP to execute SQL based queries extremely efficiently even across large number of nodes. All XAP Data Grid APIs are supported including distributed transactions, leasing (Time To live) , FIFO , batch operations , etc. All clustering topologies supported. All client side cache options are supported.

BlobStore Configuration

The off-heap BlobStore settings includes the following options:

Property Description Default Use
write-only-block-percentage Specifies a maximum threshold for off-heap memory use. If the space containers off-heap memory usage exceeds this threshold, a BlobStoreMemoryShortageException is thrown. 80 optional

The IMDG BlobStore settings includes the following options:

Property Description Default Use
blob-store-handler BlobStore implementation required
cache-entries-percentage On-Heap cache stores objects in their native format. This cache size determined based on the percentage of the GSC JVM max memory(-Xmx). If -Xmx is not specified the cache size default to 10000 objects. This is an LRU based data cache. 20% optional
avg-object-size-KB Average object size. 5KB optional

JVM Configuration

Configure the maximum off-heap(direct) memory that the JVM will allocate: -XX:MaxDirectMemorySize=100G, off-heap(direct) memory is separate from the JVM heap allocated by -Xmx. The value allocated by -XX:MaxDirectMemorySize must not exceed physical RAM, and should likely to be less than total available RAM. Default value of -XX:MaxDirectMemorySize is depends on your JVM version, Oracle Java default is 64mb.

Configuring an IMDG (Space) with BlobStore should be done via the MapDBBlobStoreDataPolicyFactoryBean, or the MapDBBlobStoreConfigurer. For example:

GSC_JAVA_OPTIONS="-server -Xms20g -Xmx20g -XX:MaxDirectMemorySize=100g -Xmn6g -XX:+UseG1GC"; export GSC_JAVA_OPTIONS

PU Configuration

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""

    <blob-store:mapdb-blob-store id="offheapBlobstore" write-only-block-percentage="80"/>

    <os-core:space id="space" url="/./myDataGrid" lookup-groups="${}">
        <os-core:blob-store-data-policy blob-store-handler="offheapBlobstore" cache-entries-percentage="0"

    <os-core:giga-space id="gigaSpace" space="space"/>

Programmatic approach to start a BlobStore space:

String spaceURL = "/./mySpace";
MapDBBlobStoreConfigurer configurer = new MapDBBlobStoreConfigurer();
MapDBBlobStoreHandler  mapDBBlobStoreHandler = configurer.create();

BlobStoreDataCachePolicy cachePolicy = new BlobStoreDataCachePolicy();

UrlSpaceConfigurer urlConfig = new UrlSpaceConfigurer(spaceURL);
GigaSpace gigaSpace = new GigaSpaceConfigurer(;

The above example:

  • Configures the off-heap BlobStore bean.
  • Configures the Space bean (Data Grid) to use the blobStore implementation.

Space Class Configuration

By default any Space Data Type is blobStore enabled. When decorating the space class with its meta data you may turn off the blobStore behavior using the @SpaceClass blobstoreEnabled annotation or gs.xml blobstoreEnabled tag.

Here is a sample annotation disabling blobStore mode:

@SpaceClass(blobstoreEnabled = false)
public class Person {

Here is a sample xml decoration for a POJO class disabling blobStore mode:

    <class name="com.test.Person" "blobstoreEnabled"="false" >