Error code 12: Cannot allocate memory
Since you don't get it all the time, it means periodically mysql is having a problem with the amount of memory that is being requested on that particular page load.
What's odd is that query shouldn't produce *that* many results, since it's only grabbing info about online users browing that one particular forum.