Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] stack overflow error in jetty high level API

I am doing POC on jetty http2 client,i am using jetty version 9.3.7.v20160115. Below is my code snippet.

I did load test with 1 million records,i posted 200 msg/sec to end point url using jetty high level API, I see below Stack over . If I increase -Xss jvm argument value to 25MB then i did not see any stack overflow error.I am using -Xms4g and -Xmx6g.

We may face memory issue in production if we set -Xss value  as 25MB,it allocates 25MB to each thread which are running in JVM. If there 1000 threads running then it requires 24 GB of memory, so please tel us what is the optimal -Xss value we have to use it for -Xss jvm argument?


 public class Test{

             public static void main(String args[]){

                ALPN.debug = true;
        HTTP2Client http2Client = new HTTP2Client();
        http2Client.start();             
        
        SslContextFactory ssl = new SslContextFactory(true);
        ssl.setKeyStore(getKeyStore());
        ssl.setKeyStorePassword("");
        
        HttpClient client = new HttpClient(new HttpClientTransportOverHTTP2(http2Client), ssl);

    System.out.println("-----Max request per destination"
+ client.getMaxRequestsQueuedPerDestination());
        client.setMaxRequestsQueuedPerDestination(1000000);
        
System.out.println("client.getMaxRequestsQueuedPerDestination()"
+ client.getMaxRequestsQueuedPerDestination());
        
        client.start();
        
        
        long start =System.currentTimeMillis();    

        for (int i=0;i<1000000;i++){
        
        
        System.out.println("Sending" + i);

        
        Request req = client.POST("https://test.com");

        req.send(new ResponseListener(i,"")); 
       }
        
}
}


Stack Overflow Error:

(2016-08-11 10:31:31,684) WARN  [-::HttpClient@1160621839-519]  [org.eclipse.jetty.util.thread.QueuedThreadPool:629]

java.lang.StackOverflowError

                at org.eclipse.jetty.client.HttpConnection.normalizeRequest(HttpConnection.java:98)

                at org.eclipse.jetty.http2.client.http.HttpConnectionOverHTTP2.send(HttpConnectionOverHTTP2.java:53)

                at org.eclipse.jetty.http2.client.http.HttpDestinationOverHTTP2.send(HttpDestinationOverHTTP2.java:37)

                at org.eclipse.jetty.http2.client.http.HttpDestinationOverHTTP2.send(HttpDestinationOverHTTP2.java:27)

                at org.eclipse.jetty.client.MultiplexHttpDestination.process(MultiplexHttpDestination.java:143)

                at org.eclipse.jetty.client.MultiplexHttpDestination.send(MultiplexHttpDestination.java:72)

                at org.eclipse.jetty.client.MultiplexHttpDestination.release(MultiplexHttpDestination.java:166)

                at org.eclipse.jetty.http2.client.http.HttpConnectionOverHTTP2.release(HttpConnectionOverHTTP2.java:70)

                at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.release(HttpChannelOverHTTP2.java:79)

                at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.exchangeTerminated(HttpChannelOverHTTP2.java:86)

                at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:449)

                at org.eclipse.jetty.client.HttpReceiver.abort(HttpReceiver.java:525)

                at org.eclipse.jetty.client.HttpChannel.abortResponse(HttpChannel.java:129)

                at org.eclipse.jetty.client.HttpSender.terminateRequest(HttpSender.java:373)

                at org.eclipse.jetty.client.HttpSender.abort(HttpSender.java:548)

                at org.eclipse.jetty.client.HttpSender.anyToFailure(HttpSender.java:342)

                at org.eclipse.jetty.client.HttpSender$CommitCallback.failed(HttpSender.java:706)

                at org.eclipse.jetty.http2.client.http.HttpSenderOverHTTP2$1.failed(HttpSenderOverHTTP2.java:82)

                at org.eclipse.jetty.http2.HTTP2Session$PromiseCallback.failed(HTTP2Session.java:1251)

                at org.eclipse.jetty.http2.HTTP2Flusher$Entry.failed(HTTP2Flusher.java:366)

                at org.eclipse.jetty.http2.HTTP2Flusher.closed(HTTP2Flusher.java:327)

                at org.eclipse.jetty.http2.HTTP2Flusher.append(HTTP2Flusher.java:110)

                at org.eclipse.jetty.http2.HTTP2Session.newStream(HTTP2Session.java:449)

                at org.eclipse.jetty.http2.client.http.HttpSenderOverHTTP2.sendHeaders(HttpSenderOverHTTP2.java:86)

                at org.eclipse.jetty.client.HttpSender.send(HttpSender.java:204)

                at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.send(HttpChannelOverHTTP2.java:73)

                at org.eclipse.jetty.client.HttpConnection.send(HttpConnection.java:202)

                at org.eclipse.jetty.http2.client.http.HttpConnectionOverHTTP2.send(HttpConnectionOverHTTP2.java:59)

                at org.eclipse.jetty.http2.client.http.HttpDestinationOverHTTP2.send(HttpDestinationOverHTTP2.java:37)

                at org.eclipse.jetty.http2.client.http.HttpDestinationOverHTTP2.send(HttpDestinationOverHTTP2.java:27)

                at org.eclipse.jetty.client.MultiplexHttpDestination.process(MultiplexHttpDestination.java:143)

                at org.eclipse.jetty.client.MultiplexHttpDestination.send(MultiplexHttpDestination.java:72)

                at org.eclipse.jetty.client.MultiplexHttpDestination.release(MultiplexHttpDestination.java:166)

                at org.eclipse.jetty.http2.client.http.HttpConnectionOverHTTP2.release(HttpConnectionOverHTTP2.java:70)

                at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.release(HttpChannelOverHTTP2.java:79)

                at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.exchangeTerminated(HttpChannelOverHTTP2.java:86)

                at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:449)

                at org.eclipse.jetty.client.HttpReceiver.abort(HttpReceiver.java:525)

                at org.eclipse.jetty.client.HttpChannel.abortResponse(HttpChannel.java:129)

                at org.eclipse.jetty.client.HttpSender.terminateRequest(HttpSender.java:373)

                at org.eclipse.jetty.client.HttpSender.abort(HttpSender.java:548)

                at org.eclipse.jetty.client.HttpSender.anyToFailure(HttpSender.java:342)

                at org.eclipse.jetty.client.HttpSender$CommitCallback.failed(HttpSender.java:706)

                at org.eclipse.jetty.http2.client.http.HttpSenderOverHTTP2$1.failed(HttpSenderOverHTTP2.java:82)

                at org.eclipse.jetty.http2.HTTP2Session$PromiseCallback.failed(HTTP2Session.java:1251)

                at org.eclipse.jetty.http2.HTTP2Flusher$Entry.failed(HTTP2Flusher.java:366)

                at org.eclipse.jetty.http2.HTTP2Flusher.closed(HTTP2Flusher.java:327)

                at org.eclipse.jetty.http2.HTTP2Flusher.append(HTTP2Flusher.java:110)

                at org.eclipse.jetty.http2.HTTP2Session.newStream(HTTP2Session.java:449)

                at org.eclipse.jetty.http2.client.http.HttpSenderOverHTTP2.sendHeaders(HttpSenderOverHTTP2.java:86)

                at org.eclipse.jetty.client.HttpSender.send(HttpSender.java:204)

                at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.send(HttpChannelOverHTTP2.java:73)

                at org.eclipse.jetty.client.HttpConnection.send(HttpConnection.java:202)

                at org.eclipse.jetty.http2.client.http.HttpConnectionOverHTTP2.send(HttpConnectionOverHTTP2.java:59)

                at org.eclipse.jetty.http2.client.http.HttpDestinationOverHTTP2.send(HttpDestinationOverHTTP2.java:37)

                at org.eclipse.jetty.http2.client.http.HttpDestinationOverHTTP2.send(HttpDestinationOverHTTP2.java:27)

                at org.eclipse.jetty.client.MultiplexHttpDestination.process(MultiplexHttpDestination.java:143)

                at org.eclipse.jetty.client.MultiplexHttpDestination.send(MultiplexHttpDestination.java:72)

                at org.eclipse.jetty.client.MultiplexHttpDestination.release(MultiplexHttpDestination.java:166)

                at org.eclipse.jetty.http2.client.http.HttpConnectionOverHTTP2.release(HttpConnectionOverHTTP2.java:70)

                at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.release(HttpChannelOverHTTP2.java:79)

                at org.eclipse.jetty.http2.client.http.HttpChannelOverHTTP2.exchangeTerminated(HttpChannelOverHTTP2.java:86)



Thanks

Prakash


Back to the top