OSX programs crashing, 'Kernel: file: table is full'

Over the last few months, I've seen increasingly erratic behaviour on OSX (10.8.5). Chrome won't load elements on a page, my dev tools crash etc.

Recently I had a look in Console and found that whenever an app crashes, the message that seems to go with it (or before it) is:

'Kernel: file: table is full'

A reset seems to help, but these are getting increasingly often. This is the first time I've been really frustrated owning a Mac, my last one was trouble free for years. This is a MBA purchased about August last year.

Any clues on what this is, how it could be sorted? Google yields very, very few results.


Solution 1:

I solved my own problem - but figured I'd answer for anyone else searching for the same thing.

I run CodeKit to help minimise CSS and JavaScript when building websites. The program works beautifully, but I had it monitoring all the sites (25 or so) I'd built over the past year or so for changes when it was open. I figure this was causing it to open (or at least monitor) thousands of files, resulting in the file table issue.

By only selecting the site I'm working on to monitor, everything is working perfectly (again) and as a plus - the CodeKit CPU usage has dropped dramatically.

Solution 2:

I'm on Mavericks not Mountain Lion but I've also had this problem repeatedly over the past couple of months and in my case I've tracked it down to iTunes. After a few days of running it will gradually accrue thousands of open files - enough to reach the file table's limit.

I have a short script that monitors the file table use and if I catch it before it's managed to reach the limit, a reboot can be avoided. Restarting iTunes will completely fix the problem.

The latest update to iTunes 11.1.5 didn't solve the problem.