Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

FlashCrossDomainHandler causes the CPU usage goes up to 100% in Openfire 3.7.x

$
0
0

Our company deployed a lastest openfire server (3.7.1 alpha) for production test.

We found that after running for several hours, the openfire server always has a 

100% CPU usage.

 

By using the jvirtualVM to monitor the CPU usage sample graph,  we found this

is caused by the read() method (see the code below) of the FlashCrossDomainHandler

class. it can run into a infinite loop under some circumstances.

 

protected String read(BufferedReader in) {

        StringBuffer buffer = new StringBuffer();

        int codePoint;

        boolean zeroByteRead = false;

 

        try {

            do {

                codePoint = in.read();

 

                if (codePoint == 0 || codePoint == '\n') {

                    zeroByteRead = true;

                }

                elseif (Character.isValidCodePoint(codePoint)) {

                    buffer.appendCodePoint(codePoint);

                }

            }

            while (!zeroByteRead && buffer.length() < 200);

        }

        catch (Exception e) {

            Log.debug("Exception (read): " + e.getMessage());

        }

 

        return buffer.toString();

}

 

 

Then we commented the read() method, the validation of the incoming stream and

returned the cross domain policy text straightway in while loop of the startServer()

method , as the result the CPU usage became normal.

 



Viewing all articles
Browse latest Browse all 10742

Trending Articles