External monitor goes black for short periods on MBP mid 2010 but not on same machine running Windows Can anyone advise on how to stop this happening.

The external monitor attached to it goes black for a few seconds but then comes back to show the Desktop etc.

When I boot into Windows 7 64 bit Pro (via Boot Camp) this never happens. So I don't think it's a hardware issue.

Please advise.

Update

Removed OS version from title as issue occurred in several versions. Added versions where seen as tags.

It never happened with Mavericks (but did following the upgrade to Yosemite, went away, then came back after a while after upgrading to El Capitan (I think) but also Sierra).
I did have this with my Mac Air and it was a bad cable.

I replaced it and then it would crash, if that happens try this:


  system prefs > security > advanced > uncheck logout after xx minutes of inactivity


Someone on this site suggested it for display crashes and it worked beautifully for me.