Well, what is stored is an object reference in memory, so in that regard you don't store it twice. However, there is overhead for each node you create. Plus, if you have a cache loader, then a copy is made to disk and you will have the overhead.
I believe the Pojo cache takes care of the referencing issues? So, you should only have a single copy of the object persisted.
yep, the reference is only stored, but i am also writing it to file, cant do anything there, just have to write it twice..
PojoCache has the restriction of not doing ref counting for primitive type now, e.g., we consider String as primitive since it is constant. So if you are referring only String type, then PojoCache won't do this for you.
this is wat i use to get the treecache instance
MBeanServer server = MBeanServerLocator.locate();
TreeCacheMBean tree = ( TreeCacheMBean ) MBeanProxyExt.create( TreeCacheMBean.class, "jboss.cache:service=TreeCache", server );
the object i am caching is a string , with a string as key..
Yeah, unless you are willing to wrap the String in abother helper class and use PojoCache to store the helper POJO, otherwise not much can be done there.