You can do this dynamically using "maxBytesLocalOffHeap" parameter.
so if you have only one cache in your application using 100M of Bigmemory your example configuration would be like :
CacheManager cm = CacheManager.create();
CacheConfiguration ccf = new CacheConfiguration();
ccf.setName("test");
ccf.setMaxEntriesLocalHeap(5000);
ccf.setOverflowToOffHeap(Boolean.TRUE);
ccf.setmaxBytesLocalOffHeap("100M");
Cache cache = new Cache(ccf);
cm.addCache(cache);
This will create a cache with 100M Bigmemory at runtime. Apart from this on the client side you have to set jvm argument -XX:MaxDirectMemorySize=150M( i.e Little larger than the Bigmemory you assign to the application)
For example I have got the cache which initialized 100M:
CacheManager cm = CacheManager.create();
CacheConfiguration ccf = new CacheConfiguration();
ccf.setName("test");
ccf.setMaxEntriesLocalHeap(5000);
ccf.setOverflowToOffHeap(Boolean.TRUE);
ccf.setMaxBytesLocalOffHeap("100M");
Cache cache = new Cache(ccf);
cm.addCache(cache);
return cache
then put data to the cache. When I found the cache nearly full, so I want add 50M to the cache dynamicly (then the cache size changed to 150M, and the data also can use). How can I add 50M to the cache dynamicly?