13 Replies Latest reply on Aug 14, 2003 11:08 AM by adrian.brock

    Persistence manager, large queues & out.of.memory

    delboypass

      I have come a cropper with the current system which I am building.

      On one machine I am hosting a queue, on another machine I have a client which is writing to this queue.

      I am trying some load tests so am writing 40,000 messages from the client to the queue.

      This ends up with the client receiving an out-of memory-exception and the same on the client.

      At this stage the queue has a fair few messages in it - about 30,000.

      The problem is that it doesnt seem to recover from this.
      If the server hosting the queue is then shut down and restarted - it shows the out-of-memory exception before completing the deployment.

      This out of memory exception is thrown after/by when the persistence manager is started up.

      What is the setup for the persistance manager. - currently I am writing the messages of the queue to a file so is hte persistence manager still holding a virtual memory copy of hte message as well and how do I stop this action!

      Thanks for the help!

        • 1. Re: Persistence manager, large queues & out.of.memory
          genman


          How much memory are you running out of memory at?

          Java usually only allows for 200MB at maximum, you can set this higher, to whatever your server allows.

          • 2. Re: Persistence manager, large queues & out.of.memory
            delboypass

            Is there a way that I can tell how much memory it is running out at.

            How do i reset the memory to be higher running JBoss.
            Do I need to use the -xm command when running java or is there a configuration change needed to be made.

            What I was more concerned about was the operation of the persistence manager or why vast amounts of memory are consumed when writing a large amount of messages to a queue which is hosted on a file.

            The reason i believe that the app is running out of memory is because somewhere these messages are not only being persisted in the dilesystem but also in memory (perhaps by the persistence manager).

            Do you know about any of these things??
            Cheers del.

            • 3. Re: Persistence manager, large queues & out.of.memory

              test

              • 4. Re: Persistence manager, large queues & out.of.memory

                1/ Check in the code if you close your JMS connections / sessions
                2/ When Jboss starts, pending JMS messages are pooled in the cache. By default the size of this cache is 500/600 (Mo !!!!). I have decrased it to a more acceptalbe value (16/32 see the MessageCache bean in jbossmq-service.xml)

                • 5. Re: Persistence manager, large queues & out.of.memory

                  What version of JBoss are u using? If you use version 3.0.X, the CacheStore is mapped to some file by default (and not the DB)

                  • 6. Re: Persistence manager, large queues & out.of.memory
                    delboypass

                    Using version 3.0.4

                    So pending messages are held in memory are you saying.
                    So that doesnt explain that when you restart the jboss application server when no meesages are pending that it also exhibits an out-of memory exception when the message queue (pesisted to disk) is full of around 40,000 messages.

                    So it looks like it is trying to read the persisted messages from the disk into memory on restart. Somewhere something is holding htese messages in memory which i think in turn is throwing the out of memory exception.

                    Ive checked the message cache as it says that if it is running out of memeory then messages in memory should be persisted to file. And this also isnt the case although ive havent played about with the messagecache size yet.

                    • 7. Re: Persistence manager, large queues & out.of.memory

                      So that doesnt explain that when you restart the jboss application server when no meesages are pending that it also exhibits an out-of memory exception when the message queue (pesisted to disk) is full of around 40,000 messages.

                      Of course that does explain the OutOfMemory!!!

                      I wrote "When Jboss starts, pending JMS messages are pooled in the cache. By default the size of this cache is 500/600 (Mo !!!!). I have decrased it to a more acceptalbe value (16/32 see the MessageCache bean in jbossmq-service.xml)"

                      So when Jboss start, your 40.000 messages are pooled in the RAM!

                      • 8. Re: Persistence manager, large queues & out.of.memory

                        So that doesnt explain that when you restart the jboss application server when no meesages are pending that it also exhibits an out-of memory exception when the message queue (pesisted to disk) is full of around 40,000 messages.

                        Of course that does explain the OutOfMemory!!!

                        I wrote "When Jboss starts, pending JMS messages are pooled in the cache. By default the size of this cache is 500/600 (Mo !!!!). I have decrased it to a more acceptalbe value (16/32 see the MessageCache bean in jbossmq-service.xml)"

                        So when Jboss start, your 40.000 messages are pooled in the RAM!

                        • 9. Re: Persistence manager, large queues & out.of.memory
                          delboypass

                          Is there a way of turning off this cache.

                          Surely a better algorithm would be to look in the filesystem, do some kind of sort, pick up the required message rather than pooling all the messages into the cache. This means that queues sizes are limited by the size of the cache.

                          • 10. Re: Persistence manager, large queues & out.of.memory
                            smeg

                            Indeed some rigourous load testing might have been
                            a good idea,
                            How do you achieve the same restriction in Version 2.4.4

                            Cheers

                            • 11. Re: Persistence manager, large queues & out.of.memory

                              There is no cache in jboss-2.4

                              Regards,
                              Adrian

                              • 12. Re: Persistence manager, large queues & out.of.memory
                                eusebio

                                I've read somewhere in the docs that there is also a maximum number of messages in 2.4 (set at a static value of 1000) - is this correct?

                                Does this mean that you can only have 1000 messages on the server or does it mean 1000 per queue?

                                • 13. Re: Persistence manager, large queues & out.of.memory

                                  I'm not aware of any such restriction.

                                  As far as I know, the limit is OutOfMemory because
                                  messages are not pushed to disk when memory is short.

                                  Regards,
                                  Adrian