Dealing with file descriptor leak in Eclipse + CDT
Current eclipse builds have the very nasty tendency to leak file descriptors to /usr/share/mime/globs (especially when using CDT). After a while you hit the max fd limit and eclipse will refuse to save your file (and workbench state).
Luckily, under linux you can save the day using 'gdb':
- Find offending fd's:
1
2
cd /proc/`pidof java`/fd
ls -la|grep globs
Write down about 5 fd numbers
- Attach with GDB:
1
gdb -p `pidof java`
For each fd enter:
1
p close(XXX)
where XXX is the fd number. Press enter after each line
- now type 'c' to continue and 'quit' to exit
- Quickly save your stuff in eclipse and exit/restart
Hooray!
This post is licensed under CC BY 4.0 by the author.