File handles retained during some operations
During url.openConnection operations, the file handle is left open and that can cause IO Handle starvation.
In case it is helpful, I think you can reproduce the behavior by doing
something like this:
1. mvn jetty:run
2. Figure out the pid for jetty
3. Figure out how many file descriptors are open after startup using:
lsof | grep <pid> | wc -l
4. Run a command like the one copied below to request the same file
over and over.
5. Run the lsof command line every few seconds to watch the FD count.
Sample command to fetch a file in a loop:
while (`true`); do curl -H "If-Modified-Since: Tue, 29 Dec 2009
20:02:16 UTC" -H "Cache-Control: max-age=0" http://localhost:8080/classpath/blueprint/screen.css;
done
Running this locally the FD count seems to fluctuate between the
baseline count and around 2x the baseline. I would guess that might
be based on how frequently the garbage collector is running and
cleaning up any connections that were not explicitly closed.
In case it is helpful, I think you can reproduce the behavior by doing
something like this:
1. mvn jetty:run
2. Figure out the pid for jetty
3. Figure out how many file descriptors are open after startup using:
lsof | grep <pid> | wc -l
4. Run a command like the one copied below to request the same file
over and over.
5. Run the lsof command line every few seconds to watch the FD count.
Sample command to fetch a file in a loop:
while (`true`); do curl -H "If-Modified-Since: Tue, 29 Dec 2009
20:02:16 UTC" -H "Cache-Control: max-age=0" http://localhost:8080/classpath/blueprint/screen.css;
done
Running this locally the FD count seems to fluctuate between the
baseline count and around 2x the baseline. I would guess that might
be based on how frequently the garbage collector is running and
cleaning up any connections that were not explicitly closed.
Leave a comment
on 2010-02-07 01:21 *
By github.importer
Imported from GitHub: http://github.com/dpp/liftweb/issues/275/find