I had a strange problem too when I noticed my Mac would briefly freeze at midnight. I found out that the "culprit" was Internet Explorer. At midnight, IE takes all of the URLs you've visited that day (a.k.a your History) and groups them into a folder. The length of this process varies depending on how many URLs you've visited during the day, and it totally locks up your machine while it's doing it.