5 Replies Latest reply on Nov 6, 2003 11:45 AM by jkressin

    Transacted sessions, memory, MessageCache

    jkressin

      Hi,

      i have an application which publishes several messages in a transacted session to a Queue (Using JBoss3.2.2). The messages are byte messages which together represent a file, therefore the need for a transacted session. I get an OutOfMemoryError when publishing the messages.
      I already played around with HighMemoryMark / MaxMemoryMark on the MessageCache without any success. The error occurs independently of Persistent / Nonpersistent delivery mode. BUT: Turning off the transaction solves the OutOfMemory. So here are my questions:

      1) If I use transacted sessions, are all messages published within the transaction held in memory until the transaction is commited?

      2) How is a group of messages in a transacted session processed - is each message passed to the MessageCache independently, or are all messages held in memory and after the commit passed as a whole?

      3) If anser to 1 is yes, can I turn this off or configure the maximum size of the messages held in memory? Decreasing the High- and MaxMemoryMark did not seem to have any effect.

      As i am trying to port an existing application from a BEA 7, unfortunately I cannot change the code (customer wont allow :(

      Thanks for any clarification on this issue, the doco is a little bit short on that!

      Jochen

        • 1. Re: Transacted sessions, memory, MessageCache

          The transactions are mainly handled by the client.

          It buffers the messages and sends them all at commit()

          Your problem is probably due to the list of messages
          being deserialized is too big to fit in memory.

          The cache or persistence hasn't seen the messages yet.

          It is a known issue with JBossMQ's network protocol.
          It shouldn't try to deserialize the message body,
          it should just put it straight into cache/persistence where
          OutOfMemory can be avoided by flushing the in
          memory version to disk.

          Regards,
          Adrian

          • 2. Re: Transacted sessions, memory, MessageCache
            jkressin

            Hello Adrian,

            thanks for your fast reply, now I understand the problem a little bit better. One additional question: You write that the problem originates from the JBossMQ network protocol. Lets say if my client would run inside JBoss, i.e. the same virtual machine, would using the JVMServerILService solve the problem?

            Thanks,

            Jochen

            • 3. Re: Transacted sessions, memory, MessageCache

              No the problem would be worse.

              The client would have n messages which are cloned
              before they are sent to server.

              Only once all messages are cloned would it start
              adding them to server which is when they are availble
              to be cached (move out of main memory).

              Perhaps, this could be

              Regards,
              Adrian

              • 4. Re: Transacted sessions, memory, MessageCache

                continued...

                Perhaps this could be improved by clearing the clients
                copy before sending to the server.
                I haven't checked the code to see whether this is in place
                already in place.

                Regards,
                Adrian

                • 5. Re: Transacted sessions, memory, MessageCache
                  jkressin

                  Hi Adrian,

                  thank you very much. Although right know I do not quite know how to solve my problem, I know at least the cause and where to start. If I find a good solution I will post it to the forum.

                  Thanks yery much for your help!

                  Jochen