[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Element life cycle across tiers  XML
Forum Index -> BigMemory
Author Message
kulbajaj

neo

Joined: 01/20/2014 00:33:00
Messages: 2
Offline

We have configured ehcache.xml as follows
Code:
 <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd"
       updateCheck="false"
       maxBytesLocalHeap="1G"
       maxBytesLocalOffHeap="4G"
       maxBytesLocalDisk="60G"
       >
 
       <defaultCache eternal="true" overflowToOffHeap="true" overflowToDisk="true" memoryStoreEvictionPolicy="LRU" />
       <cache name="demo1"></cache>
      <cache name="demo2"></cache>
 
 </ehcache>
 

Queries:-
1. Suppose we are adding elements in “demo1” cache and at certain point “demo1” Local Heap and Off-heap storages are full. Suppose there is an element E1 present only in Disk storage. If application calls get on “demo1” for E1, Fault occur for E1. Is it E1 copied from Disk to Local Heap? If yes then as Local Heap is full, Ehcache would evict an element E2 from Local Heap and then copy E4 to local Heap. Please confirm.

2. While copying E1 from Disk to local Heap, does Ehcache copy E1 to Off-heap as well?

3. Ehcache reserves 500m Local Heap each for “demo1” and “demo2”. Suppose “demo1” Local Heap is full but “Demo2” Local Heap is not full. If user try to add an element into “demo1”, Is there a configuration setting by which “Demo1” can use “Demo2” unutilized Local Heap?

4. We can increase Maximum Serialized Size of an Element by using “net.sf.ehcache.offheap.com.company.domain.State.config.idealMaxSegmentSize”. Suppose it’s value set to 30MB.
Is it the smallest amount of off heap that will be allocated? Does it mean that to store a 1MB object, BigMemory will allocate a 30MB chunk of memory and waste 29MB?
ljacomet

master

Joined: 03/06/2013 07:45:49
Messages: 79
Offline

Some of the answers depend on the version you are using.

Can you specify your version?

Louis Jacomet
Terracotta engineer
kulbajaj

neo

Joined: 01/20/2014 00:33:00
Messages: 2
Offline

bigmemory-go-4.1.0(ehcache-ee-2.8.0.jar)
ljacomet

master

Joined: 03/06/2013 07:45:49
Messages: 79
Offline

Given the version 2.8.0 of ehcache enterprise:
1. Yes, but E2 would go to off-heap.

2. No

3. Ehcache does not split the memory between caches, rather the caches consumme memory from the common pool. There is no demo1 full vs demo2 not full, there is demo1 and demo2 in a 1GB pool, either full or not.

4. You should not use this setting unless faced with value storage errors. Default value is at 32MB. Space will not be wasted.

Hope this helps!

Louis Jacomet
Terracotta engineer
 
Forum Index -> BigMemory
Go to:   
Powered by JForum 2.1.7 © JForum Team