java
Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-02-2009, 13:35
rvantwisk rvantwisk is offline
Junior Member
 
Join Date: Jan 2009
Posts: 5
Default File descriptors keeps growing.


hey All,

this might be a double post but I couldn't find my graph anymore!

Looking at the above line, does that mean that some application doesn't close it's file descriptors? For me looks like it that way!!

Would it help to figure out what application it is by re-deploying each application in a 1 hour timeframe and see when the graph drops.
When the graph drops I know what application it was..

Ries
Reply With Quote
  #2  
Old 04-02-2009, 22:49
kjkoster kjkoster is offline
Forum Operator
 
Join Date: Jul 2008
Posts: 1,126
Default

Dear Ries,

I agree with you that this looks like a file descriptor leak.

Redeploying individual applications will only help if the open file descriptors are actually closed upon redeployment. You can always try, of course. It might or might not work.

You can use tools such as lsof(8) or sockstat(1) to make a list of open file descriptors for your process. That will give you an idea of what kind of resource is leaking (files, database connections or network connections).

If you have access to the code, do a code review to check that all file and network resources are being closed in a finally{} block.

Tools such as findbugs may help you with this. Findbugs will actually work even if you only have the compiled JAR files. Note that the current release of findbugs, 1.3.7, has a bug that causes false positives for database resource cleaning.

Kees Jan
Reply With Quote
  #3  
Old 04-02-2009, 23:00
rvantwisk rvantwisk is offline
Junior Member
 
Join Date: Jan 2009
Posts: 5
Default

Kees,

yes I have access to all code and beable to complete these. I was just hoping that my application server would knew who opened what resources and would close them up-on un-deployment.

I will use lsof and sockstat to see what's going on.

Ries
Reply With Quote
  #4  
Old 05-02-2009, 06:30
kjkoster kjkoster is offline
Forum Operator
 
Join Date: Jul 2008
Posts: 1,126
Default

Dear Ries,

Well, Java knows what resources are being used and by whom. It's just a matter of finding a way to make the JVM spill the beans, so to speak, and tell us about it too.

To get more detail on the leaking resources, you can use jmap to make a memory dump and use jhat to trawl through that to find objects that represent the resources that have been leaking.

First use the command line tools, though. More often than not it tells you everything you need to know. In your shoes I would probably run them hourly from a cron script and with some awk(1) magic plot the various resource types in a spreadsheet.

Kees Jan
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump