[jboss-dev-forums] [Design of JBossCache] - Space versus time, e.g. JBCACHE-1157

genman do-not-reply at jboss.com
Mon Jul 30 21:56:58 EDT 2007


JBCACHE-1157 changes the HashMap used in an UnversionedNode to a ConcurrentHashMap, which makes an empty node take about 1.3K to store, from about 150 bytes. To do this sort of change on 1.4 might affect people's runtime memory usage quite a bit. For 2.0, I don't know. A cache that has so much overhead sort of bothers me.

Perhaps with a "global" NavigableMap (backported from 1.6), you could store all the data in a single flat map, with the following techniques:

1. Node.put(k, v) -> NM.put(new Pair(Fqn, k), v)
2. Node.getMap() -> NM.getRange(new Pair(Fqn, FirstKey), new Pair(Fqn, LastKey));

The main downside is that all operations are of course slower, depending on how the Fqn is constructed. (A Fqn is much faster than Fqn).

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068969#4068969

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068969



More information about the jboss-dev-forums mailing list