Page 1 of 1

Broadleafdemo with Terracotta BigMemory

Posted: Tue Dec 27, 2011 12:14 pm
by don c
Listening to http://www.slideshare.net/crederajfisch ... f-commerce

1. How do I configure Broadleafdemo to use Terracotta BigMemory ?
Is it as simple as modifying bl-override-ehcache.xml to have a 'offheap' component ?

2. I guess I have to have a license to use Terracotta BigMemory ?

Many thanks,
Don

Re: Broadleafdemo with Terracotta BigMemory

Posted: Tue Jan 03, 2012 12:42 pm
by jefffischer
TerraCotta themselves will have most of the instructions. It basically boils down to:

- Having a license for the product
- Adding an off heap memory space at JVM startup (-XX:MaxDirectMemorySize)
- editing the ehcache xml configuration to include the support for BigMemory

This is basically no different than any other application that uses ehcache and would like to take advantage of BigMemory.

In regard to the webinar you mention, Broadleaf provides a special kind of cache that we call a "hydrated cache". This cache can be used to store full versions of an object while binding the lifecycle of that object to another ehcache lifecycle, presumably defined in a cache region for a group of hibernate objects. This can be useful if you're trying to cache some objects related to a Hibernate objects and you want to make sure the related object cache is expired at the same time the Hibernate cached object is expired. We have provided an implementation of this hydrated cache for BigMemory as well.

Based on our results, the use case that makes the most sense for BigMemory with Broadleaf Commerce is when you have an extremely large catalog and your cache time-to-live for those catalog members are extremely short because there are one or more facets of the catalog members that change frequently. In this case, with BigMemory, you don't get hit with the GC for popping so many members in and out of the cache.