2 Replies Latest reply on Aug 10, 2011 10:42 PM by minhld

    how to replicate the memory in heap between the instances of an application in cluster

    minhld Newbie

      Hi all,

       

      Please help me for this issue I'm having..

      I had a web service application which calls a C++ library and uses a piece of memory in heap (which cannot be stored in any Java object), and it has been working well in our single JBoss server. Now I would like to deploy the application on a JBoss cluster, and my problem is to synchronize that piece of memory in heap between the instances of application installed on the nodes in cluster.

      I have read about JBoss Cache and honestly I haven't found any idea for this. Please help, any suggestion will be appreciated!

       

      minh

        • 1. Re: how to replicate the memory in heap between the instances of an application in cluster
          Paul Ferraro Master

          If this heap block can be stored in a java byte[], then you can store the array in a clustered cache, whether it's Infinispan or JBoss Cache.

          That way byte[] can then be accessed from any node in the cluster.

          • 2. Re: how to replicate the memory in heap between the instances of an application in cluster
            minhld Newbie

            Hi Paul,

             

            Thank you for your answer, but in this case I cannot store data in java binary array due to matter of speed. I will describe in more detail:

            We are creating a web service application for iris recognition. When the application starts, it loads a library (c++ dll) into the memory, and an initialization function from the library will create a block of memory in heap. After that, each function call from java layer will call to a corresponding function in the c++ library and use that block (retrieving/add/update/delete data on it). That block of memory is shared between all sessions and managed by c++ layer because every update on that block from c++ is much faster than from java side.

            We are now trying to deploy our application to a cluster to utilize load balancing, and the problem is the shared memory... We don't know how to make a virtual shared memory block in between the nodes in cluster, so update from a node will affect to other nodes.

            Do you have any idea for this?

             

            minh