0 Replies Latest reply on Apr 10, 2006 2:27 AM by Elias Ross

    Sizes of things

    Elias Ross Master

      I spent some time last week thinning down the sizes of permanent objects (to me, there's not too much point in reducing temporary waste as the garbage truck takes care of it). This is so that I can hold 1,000,000+ fairly small objects. Plus, I'm a little overly conservative with runtime memory, perhaps due to writing my first programs for the Commodore 64.

      Anyway, for comparison, here's the sizes for some common structures, empty:

       [java] class java.util.concurrent.ConcurrentHashMap: 1271
       [java] class EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap: 748
       [java] class EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap: 160
       [java] class java.util.HashMap: 120 (zero entries is 43)
       [java] class java.util.ArrayList: 80 (zero is 39)
       [java] class java.util.LinkedList: 47
       [java] class java.lang.String: 39
       [java] class java.util.concurrent.CopyOnWriteArrayList: 32
       [java] class org.jboss.cache.TreeCache: 2659
       [java] class org.jboss.cache.Fqn: 15 (plus ArrayList for non-root)
       [java] class org.jboss.cache.Node: 21
      


      I'll take a look at the eviction package though, I think I'm pretty much done for size optimization (JBCACHE-555). Maybe there are some further suggestions?