I'm having the same problem. Upon launching Mail, it is not functional and consumes so much RAM (between 4.7 and 5 gb according to Activity Monitor, many times higher than any other application), that it also renders the entire system unusable until I force quit. My problem also started right around the time I upgraded to OS X 10.7.2. I ended up buying a third-party email application from the App Store just to be able to use email on my machine.
I tried launching Mail in 32-bit mode and it did not solve the problem.
This is ridiculous. Every time Mail checks for or downloads new messages it starts taking up almost 50% of each CPU core! Here's a screenshot from the iStat Pro dashboard widget. As you can see, mail is at 195% of the processor capacity and the CPU load bars are all around 50% (the other 4 bars with almost nothing are the hyperthread bars, I believe).
Mail stays like this for over a minute. This happens after every wake from sleep and every time new mail arrives. This never happened before and the problem is definitely with 10.7.2.
In another similar discission, a user named danthemanuk posted this solution. It's not a very easy or quick solution though, but perhaps it's worth a try.
Here's the discission and I've embedded the quote below.
I have finally fixed my problem with iCloud pref pane not responding when opened/freezing/using loads of system resources. This has also fixed my problem with Mail Contacts and Calendar pref pane doing the same thing and also stopped Mail.app running extremely slow. However, the method I used might not be appealing to some of you guys having similar problems.
Basically I have got a MacBook and iMac both with the same problem both setup about the same. MacBook I don't use as much so I tried creating a new user account and seeing if the problems persisted. Under the new user account everything worked fine. So I guess in theory you could create a new user account and transfer all your files across to it using the shared folder.
I decided however to do a time machine backup first. Backup anything that was on my MacBook but not on my iMac and then do a clean install of lion so it is back to how it comes out the factory. Created a new user account, did not restore from a time machine backup or use migration assistant during the installation. So once had it back to factory condition I installed updates and then checked iCloud and Mail, Contacts and Calendars pref panes were all working ok and that mail.app was working ok as well. Copied across all my music, movies, docs, photos etc from my iMac and external HD, used migration assistant to copy across just my applications from my iMac.
As of this moment everything is working fine, mail.app is ok and so are all my pref panes.
I realise this method may be a bit extreme for some people to do just to get a one or two pref panes and maybe mail.app to work ok but it worked for me.
I have installed 10.7.3 and still have these problems.
There must be some corrupt file or a file with incorrect permissions or something. But I've reinstalled OS X 3 times and have run permissions check/repair several times.
I just tried doing what danthemanuk suggested (quoted in my reply above this one) and Mail and iCloud preferences work perfectly in a new user account.
What could be causing this?
I've fixed it!
After 10.7.3 the double reboot problem seems to have gone away on its own.
But I've had success in repairing my inrecibly slow Mail and frozen iCloud preferences.
I can't guarantee this works for everyone, but here is what I did.
I suggest performing a Time Machine backup before completing these steps.
Quit Mail, Calendar, Address Book, and System Preferences if they are open.
Go to your user Library. Lion hides this folder by default, so in order to do this you must go to your Home folder and then select Go > Go to folder... in the Go menu, or hit Command + Shift + G on the keyboard.
Type in "Library" and hit Return. You should now see the contents of your Library folder.
Perform a search for "icloud", making sure it's only searching the Library folder by using the search parameters at the top of the window.
Delete the files in the search results.
Next, close the search results by hitting the X in the search bar. You should be seeing your Library contents again.
Be warned that this next step may not be necessary, but I did it anyway since I knew I wouldn't be losing my emails by doing this.
Locate the folder called "Mail". Now, before this next step I will say that I have all my email accounts running on IMAP. If you are using POP, I suggest backing up the data within the folder Mail > V2 to make sure you do not lose any emails. If you already have a Time Machine backup that should suffice.
Delete the folder called "Mail". This should get rid of your email accounts, as well as your emails. If you're using IMAP this won't be a problem because when you setup Mail again it will download the emails from your email providers.
Open System Preferences. Go to Mail, Contacts & Calendars. If you see an iCloud account, delete it.
Click Show All at the top of System Preferences. Open iCloud preferences. It should now display the iCloud login screen. Log in to iCloud and follow the prompts.
Find My Mac
During the iCloud setup process you may notice that Find My Mac is unavailable. If this is the case, once you've completed the iCloud setup you may see "Requires recovery partition" below the Find My Mac option. Don't worry, a simple restart of your Mac will fix this. Reboot your Mac and you'll be able to activate Find My Mac.
I hope this helps someone out there! I can finally use Mail and iCloud preferences again.
This fix by Heronymo worked for me for a while, but I have the problem back again, and I'm working with 10.7.4. Every time I try to access icloud in system preferences on the icloud pane or the mail, contacts and calendars pane, the preferences becomes unresponsive and slowly every other program I'm running that accesses the internet becomes unresponsive (mail, firefox, ical, safari, etc.). I have to force quit at least system preferences to be able to use my machine again. I did copy back my Mail > V2 folder to it's original location. Could that have brought the problem back? if so, is there a way to permanently fix this and not loose my settings and messages for my hotmail and one other POP account?