This problem shows up a day or two after rebooting. Launching any new window will be very slow. It comes up first with either just a transparent overlay or with the window grayed out and the rest of the system stalled. After maybe 30s to a minute the window will eventually show up fully. At that point everything works fine with no noticeable performance problems, until i need to launch another window. Also whenever I hit this problem, I also can't do anything within the system tray. The clock in the tray even stops updating. The system tray stays frozen whether i'm stuck launching a window or not. I don't see anything helpful or even recent in dmesg. Top doesn't show anything too unusual in cpu or mem usage, although I don't think its display is updating while the system is frozen waiting for a window to open.
Reboot and everything's back to normal.
Also this problem shows up suddenly. By that I mean everything is normal and then I try to open a window and its very slow to load. Its not like opening windows gradually gets slower over time.
This is on 14.04, nvidia 331 driver, unity.
xdg-mime query default inode/directory
in terminal (