   Terrible frame hiccups, 200ms for 0 triangles!
  As I've been playing with my program lately I've been noticing a weird problem. The game runs really smoothly (<2ms whole frame time) as measured with Hi-Res timers, although every so often get a really bad framerate hiccup that's very noticible during gameplay. I profiled it to the renderer, then to swapbuffers, and started removing pieces of the rendering pipeline until I could see what was causing it.Unfortunately I'm to the point where I've removed Everything from the rendering pipeline, and its still happening. This is now the entirety of my program, I call SwapBuffers in a loop and do nothing else. No glClear, no updates, nothing.while (!exiting){if(initialized) { //Ignore very first startup framestimer.startTimer();SwapBuffers(hDC);timer.stopTimer();rendertimes = timer.getElapsedTime();timer.clearTimer();}i++;if(i==1000){i=0;if(initialized==true){int stop = 1;//Breakpoint here}initialized=true;}while (PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE)){if (!GetMessage (&msg, NULL, 0, 0)){exiting = true;break;}TranslateMessage (&msg);DispatchMessage (&msg);}I break after going through the second thousand frames and scroll through the rendertimes in the debugger. Scrolling down the list most are 0.1ms which is ok, but then every so often I'll see one enormous frame, sometimes several in a short time. I could see something like this:0.00010.00010.00010.20140.00010.00010.09410.00010.00010.00010.00010.00010.00010.00010.03800.00010.00010.0001Game is freezing for 200ms to perform a single frame! Any thoughts what I can do to stop this?Edit: OS is Windows Vista, GPU is 8800GTS[Edited by - karwosts on April 29, 2010 11:51:32 AM]
  Total long shot: try switching to PM_REMOVE.Also, are you running with vsync enabled?   ;  I can try that later when I get back, although my message loop is outside the timer so I'm not sure if that will help much.I'm pretty sure vsync is off, like I said typically the loop time is ~0.1ms   