Any implications to increasing "xmpp.parser.buffer.size" to larger values?

Hello,

I have a question in relation to updating the value of “xmpp.parser.buffer.size”. I understand that the default size is set to 1MB, and that it can be changed up to a max size of 2GB. My project is utilizing Openfire 3.7.1 as a Message Oriented Middleware (MOM) for the request/response of data between remote applications. However, depending on the query, there could be much more than 1MB of data in the XML response. We’ve seen anywhere from 25-50MB in early tests. Of course, these large responses don’t happen very frequently (maybe once every 10-20 hours). And we also use Openfire for a lot of very small messages (possibly up to a rate of at 1 message per second).

Therefore, I was hoping that we could possibly just increase the value of the “xmpp.parser.buffer.size” to say 50MB, or maybe 100MB. However, I didn’t know what implications there could be to the memory of the system running Openfire if the size was set to 50MB or 100MB.

Does Openfire automatically allocate the value of “xmpp.parser.buffer.size” in memory for every message? Foir instance, if we have an XML response that might only be 10KB, will 50MB of memory be allocated and used by the system all at once, even though the message is only 10KB? Or is there maybe some sort of dynamic allocation, and that only the size of the message will be allocated in memory, and the 100MB of memory will only be utilized if the message size is that large?

I just want to make sure that if the “xmpp.parser.buffer.size” is set at a high, that we don’t run into a scenario where the system runs out of memory if we start receiving a high volume of small messages.

I realize there are ways to get around this in code (like paging the response and sending a series of messages, as opposed to one large message). However, we are first trying to see if this can be accomplished without any code update (and the coordination needed due to dealing with remote sites).

Thank you very much for your assistance!

Ad there is no size attribute within the message Openfire increases the medsage buffer as needed. Setting it to 100 MB is not a big issue, anyhow if a large message is transmitted Openfire does need to allocate a lot of memory which must be available. Then processing the message may take long, you may want to test this.

For Java it is more easy to allocate and free 100x 1MB than 1x 100MB. So it could make sense to split the message into chunks.

LG,

Thanks for your response. I think that helps my analysis of the issue some. If the message buffer increases only as needed, it sounds like a 10KB message would only have to utilize that much memory to send the message, instead of allocating the entire 100MB for only 10KB in size.

As far as the speed of processing for a large file, luckily that isn’t going to be an issue. The request/response flows that could have a large amount of XML records in the response aren’t required to happen at a certain rate. So if it takes a little longer to process a single 50MB response as opposed to 50 separate 1MB response…shouldn’t be an issue.

Thanks again for your quick answer!