Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

291
Views
Troubleshooting a Java program that causes a server to hang with "too many files open"

I have a Java program runs (on linux) for a while and then causes the server to lock up with "Too many files open"

After restarting the machine, I run the java program again and then execute the lsof command against it's pid. A large number of lines with the following output are produced:

java    971 uknown  980u     sock                0,9       0t0  20461 protocol: TCPv6

Does this means the program is opening multiple tcp connections & not closing them?

What further steps can i take to troubleshoot this?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It means your program is opening file descriptors but not closing them. It may be sockets or file handlers. So it is causing resource leak. Make sure all file handlers are closed and make it ready for garbage collected.

As dan1st pointed out in comment, one preventive measure to avoid this scenario is using try-with-resources. This will implements the AutoClosable interface and make sure automatic resource closing.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!