Hi,
Work with OFF_HEAP requires more CPU time than ON_HEAP, because each "get"
should get bytes from memory (by pointer to off_heap) and deserialize these
bytes to business object.
However you can use Binary interface in order to avoid deserialization:
IgniteCache<BinaryObject, BinaryObject> =
ignite.cache(CACHE_NAME).withKeepBinary();
BinaryObject binaryObject = cache.get(key);
binaryObject.field(FIELD_NAME);
and do not copy object on each "get" (if the object does not change after
"get"):
<bean id="simple_cache"
class="org.apache.ignite.configuration.CacheConfiguration">
<property name="copyOnRead" value="false" />
...
Also if remote data processing fit to you, you can use "invoke" (on
withKeepBinary cache). At this case work will be produced over off_heap
pointer (without copy bytes to heap).
....
public Object process(MutableEntry entry, Object... arguments) throws
EntryProcessorException {
BinaryObject binaryObject =
(BinaryObject)entry.getValue();
...
On Thu, Nov 10, 2016 at 11:17 AM, rishi007bansod <[email protected]>
wrote:
> Following are average execution time for running 14 queries against 16
> million entries (DB size: 370 MB)
>
> OFF HEAP memory mode - 47 millisec
> ON HEAP memory mode - 16 millisec
>
> why there is difference in execution times between off heap and on heap
> memory modes as both are In-memory? What performance tuning can be applied
> on off heap memory mode for better results?(I have also tried JVM tuning
> mentioned in Ignite documentation, but its not giving any better results)
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/ON-HEAP-vs-OFF-HEAP-memory-mode-
> performance-Apache-Ignite-tp8870.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
--
Vladislav Pyatkov