7 Replies Latest reply on Jun 20, 2012 7:48 AM by Andy Taylor

    HornetQ not release memory when there is no process

    Alfred Wong Newbie

      im using hornetq 2.2.14, i'm run 2 cluster nodes in different host, i produce messages from node 1 and consume messages from node 2, the result works fine,

      but after all messages being consumed, i go and check "TOP" in fedora, i found that the %cpu usage is below 1 which is great, unfortunately the memory seems

      like not release at all, when the servers didnt do anything i expect the memory usage will be reduce, but the %memory always the same, and soon when i start to

      produce and consume messages again, the memory keep increase and at the end i hit the out of memory exception, is this a bug? or i configure hornetq wrongly?

      please advise me, thanks

        • 1. Re: HornetQ not release memory when there is no process
          Andy Taylor Master

          Its hard to say without any more info:

           

          how much memory does the server have?

          are you acking all messgaes?

          are you closing JMS resources properly?

          are there any warnings in the logs?

          • 2. Re: HornetQ not release memory when there is no process
            Alfred Wong Newbie

            how much memory does the server have?

            - yup, im sure the memory of the servers are fine, i had attached the node1 & node2 "TOP" details in the zip

             

            are you acking all messgaes?

            - yeah, actually i want to test the reliability of the hornetq server before deploy to production, everytime i will produce messages (e.g. 100k), and consume them all.

             

            are you closing JMS resources properly?

            - im using core api, not using the jms

             

            are there any warnings in the logs?

            - i will resimulate the issue and show you the OOM log

            • 3. Re: HornetQ not release memory when there is no process
              Andy Taylor Master

              - yup, im sure the memory of the servers are fine, i had attached the node1 & node2 "TOP" details in the zip

              I meant how much memory are you actually starting the server with and is it enough, maybe you just need to up it

               

              - im using core api, not using the jms

              ok, make sure you are closing any resources

               

              - i will resimulate the issue and show you the OOM log

              Yes but check for any other warning previous the OOM.

               

              If you do recreate it, can you provide a simple test, i.e. not with all your code, so we can recreate it?

              • 4. Re: HornetQ not release memory when there is no process
                Clebert Suconic Master

                You probably have a dead subscription (or a queue where you're not consuming messages).

                • 5. Re: HornetQ not release memory when there is no process
                  Alfred Wong Newbie

                  hi andy,

                   

                  I meant how much memory are you actually starting the server with and is it enough, maybe you just need to up it

                  - i used used the default min512 max1024, i also tried min256 max512

                   

                  ok, make sure you are closing any resources

                  - yup, in my code, after i finish the produce or consume, i will close the clientsession, clientsession factory

                   

                  Yes but check for any other warning previous the OOM.

                  - i will provide you the warning soon cause now i not in office

                   

                  If you do recreate it, can you provide a simple test, i.e. not with all your code, so we can recreate it?

                  - actually i already provided the full code in the attachement, you can try it out, or you want me to write the simple code to test produce and consume messages?

                   

                  hi clebert,

                   

                  You probably have a dead subscription (or a queue where you're not consuming messages).

                  -actually i always only used 1 queue, and then i also use the QueueQuery method to check is there message in the queue including the DLQ and ExpiryQueue

                  • 6. Re: HornetQ not release memory when there is no process
                    Alfred Wong Newbie

                    hi andy, as per requested, i had upload the hornet-attach2.zip which have the hornetq log showed the OOM

                    i also provide a simple test class and try produce 1millions records and consume them concurrently, unfortuntately consume failed due to OOM,

                     

                    fyi, im using paging which should be work fine right?

                    • 7. Re: HornetQ not release memory when there is no process
                      Andy Taylor Master

                      I've run your test a couple of times now with no errors, everything ran smoothly, between each run memory looked fine.

                       

                      looking at your oom error it is actually because of garbafe collection, search google for 'GC overhead limit exceeded' and have a read on what settings you can change, maybe its the JDK you are using or maybe its just the hardware you have!