OS X hangs up intermittently - spinning beachball of death My MacBook Pro hangs for 5 to 10 seconds intermittently. Basically, when I either click or type, the computer just hangs and then the spinning beachball shows up and it takes about 5 seconds to respond even for the simplest tasks.

Here are the computer specifications:


Macbook Pro 13-inch, Mid 2012
OS X 10.8.5 - Mountain Lion
8 GB RAM
Intel HD Graphics 512 MB
240 GB SSD (same problem occurs with the original 500 GB HDD)


Here is what I tried:


Reseting PRAM 
Checking the console log for errors. No indication of errors.
Reinstalling the operating system 
Upgrading to El Capitan. The upgrade "dies"
in the middle of the process 
Deleting all caches with Onyx software
Replacing the hard drive with a brand new SSD 
Checking for bad sectors, disk permissions and SMART status with Disk Utility 
Installing Windows 10 with bootcamp. It actually works perfectly, which makes me think this is a software related issue


Any help would be very much appreciated. I've checked all kinds of forums for a similar problem but no one seems to lead to a solution.
I ended up taking the laptop to a Apple Store and they said that the hard drive bracket needed replacement. They agreed to do it for free since it is covered by the Apple Quality program. Apparently, the hard drive bracket is something that breaks in this model and Apple has the decency of repairing it for free despite being way out of warranty. One thing I will never know is why Windows performed well despite this hardware error. Anyway, my computer runs smoothly again, specially with the new SSD.