Search code examples
eclipseperformancesamba

Eclipse performing several thousand unnecessary file requests


I have a directory with several (almost 800) JSON files in a Eclipse project. I've noticed that refreshing this directory freezes Eclipse (Mars).

The directory is on a Ubuntu Linux server running Samba 4.1.6 and I'm using Eclipse x64 on Windows 8.

I've run strace on the relevant smbd process and I saw that Eclipse is repeatedly performing a stat() on all the files (I'd expect once only):

newfstatat(32, "MYFILE-c15771bf38edb6f27f2e3a468eeda58f.json", {st_mode=S_IFREG|0644, st_size=1428, ...}, 0) = 0
stat("path/to/MYFILE-c15771bf38edb6f27f2e3a468eeda58f.json", {st_mode=S_IFREG|0644, st_size=1428, ...}) = 0
stat("path/to/MYFILE-c15771bf38edb6f27f2e3a468eeda58f.json", {st_mode=S_IFREG|0644, st_size=1428, ...}) = 0

The calls are in groups of three, one newfstatat and two stat's. While I'm writing and since I started strace, 846 requests for the same file have accumulated:

$ grep MYFILE-c15771bf38edb6f27f2e3a468eeda58f.json stracefile | wc -l
846

The same holds for all the other files (my strace file is now 1352971 lines long, and growing).

All the while, Eclipse is frozen ("Not responding"). As luck would have it, I've an open file with uncommitted changes I'm quite keen to recover.

Before filing an Eclipse bug, did anyone encounter this behaviour? Is there a way of making Eclipse stop this ceaseless enquiry on the status of a static file, long enough to save one editor window? (Cut and paste doesn't work).

And what could be causing this? Too many files in a single directory? (of a specific type)? A conflict with Samba?


Solution

  • Not a complete answer (I'm probably filing a bug), but a temporary workaround to unblock Eclipse:

    • login to the Linux server
    • move all files in the directory somewhere else
    • wait about 30 seconds for Eclipse to throw a bunch of errors as the files it was looking for disappear
    • Eclipse is now unblocked
    • close the folder in Eclipse
    • move back the files in the directory
    • log out of the server
    • note to self: do not open that folder in Eclipse again.