Earlier today, Apple Mail started doing this:
And yet it's essentially idle—the Activity window shows Mail doing absolutely nothing. Mail still responds, and if I quit it and restart, it works fine for about half an hour. And then it starts again with the thrashing. I have no idea what it's doing. It looks like I'm not the only one.