java - Hunting for “too many files” cause -


we hit strange issue on 1 of customers servers, java encounters "too many files",

checking descriptors via lsof produces large list of "sock" descriptors "can't identify protocol".

i suspect happens due sockets opened time, our thread dump contains lot of them, have no clear idea culprit.

is there method detect threads open these sockets?

thanks.

is there method detect threads open these sockets?

not threads per se.

one approach run application using profiler. find problem if cannot reproduce customer's problem. (@syber reports yourkit profiler has specific support finding socket leaks ... see comment.)

a second approach tweak test platform using ulimit reduce number of open files allowed. may make easier reproduce "too many files open" scenario in test environment.

finally, i'd recommend "grepping" codebase find places socket objects created. examine them make sure use correctly try / blocks ensure sockets closed.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -