[
https://issues.jboss.org/browse/WFLY-5731?page=com.atlassian.jira.plugin....
]
浩 陈 commented on WFLY-5731:
---------------------------
we have tried both wildfly9.0.2 and 10.0.CR4, it seems nothing changed.
I think This leak's reason maybe that:
When the thread writing this big data, output writer writes go beyond it's buffer
size, then it creates a PollSelectorImpl and wait until this buffer available. After
response Data writes successfully, this thread will be GCed by JVM, PollSelectorImpl also
be GCed.
PollSelectorImpl have create two FD but Never close them.
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
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)