1 Reply Latest reply on May 6, 2009 5:25 AM by Manik Surtani

    huge memory usage problem

    sridhar reddy Newbie

      I am trying to put populate a hashmap with certain key value pairs and add it to jboss cache node.
      There are around one lakh such nodes under the root and each node size is around 32K. So the total database size around 2GB.
      I am using JDBCCacheloader persistance.

      At the time of population (from a developer machine) i configured the maximum no of nodes as 2000 due to memory limitation in system.

      Now i started the application in server machine (64 bit Redhat Linux enterprise V5.3) with 4GB RAM and 4GB of SWAP space to load the complete cache.

      But i wondered to see that, after completely loading the data into memory, it consumed 3.5GB of RAM and 3 GB of SWAP space.

      When the total data size is 2GB, why Jboss cache is consuming more tha 3 times of space?

        • 1. Re: huge memory usage problem
          Manik Surtani Master

          There is a lot of overhead in maintaining the tree structure. The overhead varies with the type of data stored, and if you have a lot of small key/value pairs then the overhead increases quite significantly. This is one of the motivations for starting the Infinispan [1] project.

          One thing you could do is if you are using pessimistic locking, switch to MVCC which reduces the number of locks created and hence memory overhead.

          [1] http://www.infinispan.org