Openfire is using direct buffers by default instead of heap buffers
Under heavy load it is possible to run out of memory when using direct buffers. Moreover, heap buffers are much faster than direct buffers. For all this we need to use heap buffers by default. Openfire was trying to use heap buffers by default but the IF statement was the other way around.