cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Atul Bisaria (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-6239) Out of memory when using Async connections in Apache CXF
Date Tue, 03 Mar 2015 10:40:05 GMT

    [ https://issues.apache.org/jira/browse/CXF-6239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14344894#comment-14344894
] 

Atul Bisaria commented on CXF-6239:
-----------------------------------

Here are the answers:

◾What are the actual configuration values that you are using?

MAX_CONNECTIONS = 10, Response Timeout = 2 sec

◾Are you getting other errors before start piling up on the memory?

We don't get any other errors other than out of memory.

◾Is reducing the load prevents this problem? In other words, do you observe this memory
issue only at this high load?

At lower loads, out of memory would still be there but would take more time to occur.

◾Is the client expecting a response for this service?

Yes, client retries the requests based on server response.

◾what is the server?

Server is a SOAP based webservice

Regards,
Atul

> Out of memory when using Async connections in Apache CXF
> --------------------------------------------------------
>
>                 Key: CXF-6239
>                 URL: https://issues.apache.org/jira/browse/CXF-6239
>             Project: CXF
>          Issue Type: Bug
>          Components: Configuration, Transports
>    Affects Versions: 3.0.2
>            Reporter: Atul Bisaria
>            Priority: Critical
>              Labels: performance
>         Attachments: SnipImage1.JPG, SnipImage2.JPG
>
>
> We are creating a webservice client using Apache CXF version 3.0.2. We are using CXF's
async based transport as described in http://cxf.apache.org/docs/asynchronous-client-http-transport.html.
Following is the code snippet from our application:
> ---------------------------------------------------------------------------------------------
>     Client proxy = ClientProxy.getClient(tisInterface);
>     proxy.getBus().setProperty(AsyncHTTPConduitFactory.USE_POLICY, UseAsyncPolicy.ALWAYS);
>     proxy.getBus().setProperty(AsyncHTTPConduitFactory.MAX_CONNECTIONS, parConfig.getOnlineNotificationThreadCount());
>     HTTPConduit conduit = (HTTPConduit) proxy.getConduit();
>     HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
>     httpClientPolicy.setReceiveTimeout(parConfig.getTimeout() * 1000);
>     conduit.setClient(httpClientPolicy);
> ------------------------------------------------------------------------------------------
> With above configuration we are running a load of around 200 requests/second.
> On running this load we observe on Java memory analyser tool JVisualVM that heap size
keeps on increasing continuously and after some time results in Java out of memory error.
> We have refactored our code to make sure that all the objects created by our application
are properly garbage collected. The heap dump generated from JVisualVM shows that there are
some classes used within Apache CXF library which might be causing this issue.
> Almost 94% of memory is retained by object of class org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager
> Is this an issue with the async transport provided by Apache CXF or we are missing something
in code or configuration?
> Another observation is that when we use UseAsyncPolicy.NEVER instead of UseAsyncPolicy.ALWAYS
in above code, the out of memory problem does not occur, but then the value set in AsyncHTTPConduitFactory.MAX_CONNECTIONS
property does not work.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message