[jboss-jira] [JBoss JIRA] (WFLY-5731) PollSelectorImpl's FD leak for asyncServlet

Stuart Douglas (JIRA) issues at jboss.org
Mon Dec 7 22:56:00 EST 2015


     [ https://issues.jboss.org/browse/WFLY-5731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stuart Douglas resolved WFLY-5731.
----------------------------------
    Fix Version/s: 10.0.0.CR5
       Resolution: Done


The update to XNIO 3.3.3.Final should have fixed this. 

Note that you can still run out if you create and destroy a lot of threads in a very short period of time, as the Garbage collector may not be able to keep up. In general you will get way better performance with a thread pool anyway.

> PollSelectorImpl's FD leak for asyncServlet
> -------------------------------------------
>
>                 Key: WFLY-5731
>                 URL: https://issues.jboss.org/browse/WFLY-5731
>             Project: WildFly
>          Issue Type: Bug
>          Components: Web (Undertow)
>    Affects Versions: 8.1.0.Final
>         Environment: OS:Red Hat Enterprise Linux Server release 5.5 (Tikanga) 
> MW:wildfly-8.1.0.Final
> JDK:
> java version "1.7.0_25"
> Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
> Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
>            Reporter: 浩 陈
>            Assignee: Stuart Douglas
>            Priority: Critical
>             Fix For: 10.0.0.CR5
>
>         Attachments: DemoServlet.java
>
>
> AsyncServlet doGet() like this: 
>     protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws     ServletException, IOException {
> 		resp.setContentType("text/html;charset=UTF-8");
> 		AsyncContext ctx = req.startAsync();
> 		new Thread(new Executor(ctx)).start();
> 	}
> public class Executor implements Runnable {
> 		private AsyncContext ctx = null;
> 		public Executor(AsyncContext ctx) {
> 			this.ctx = ctx;
> 		}
> 		public void run() {
> 			try {
> 				char[] data = new char[1024 * 1024 * 1];
> 				PrintWriter out = ctx.getResponse().getWriter();
> 				out.write(data);
> 				out.flush();
> 				ctx.complete();
> 			} catch (Exception e) {
> 				e.printStackTrace();
> 			}
> 		}
> do request this Servlet some times , run linux cmd :
> lsof -p [JAVAPID]|grep pipe|wc -l
> this number increases by two every one request,but never decrease! when this number up to OS's open file limit everything is not OK.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)



More information about the jboss-jira mailing list