intermittent freezes, glPushAttrib

On certain machines running Windows, with Nvidia cards, our OpenGL code experienced intermittent freezes. That is, once in a while at irregular intervals, everything (including the mouse cursor) would freeze for maybe 3 to 8 seconds. We couldn’t reproduce it on a PC with an ATI card, nor on a Mac with an Nvidia card.

The problematic area of the code looked like this:

glPushAttrib( GL_LINE_BIT );
glLineWidth( myWidth );
DrawSomeLines();
glPopAttrib();

After changing it to the following, the problem went away:

glLineWidth( myWidth );
DrawSomeLines();
glLineWidth( 1.0f );

And if I did this, the problem came back:

glPushAttrib( GL_LINE_BIT );
glPopAttrib();

glLineWidth( myWidth );
DrawSomeLines();
glLineWidth( 1.0f );

Any of this ring any bells?

I have expirienced the same probem, the machine was Laptop with nVidia Quadro card. The rendering flow was much more complecated than this one but once i removed push/pop-attrib all begin to works fine - yet i have no idea why it works like this with push/pop sequence.

It can be that the driver allocated a block of ram to push/pop attribs, and a small memory leak cause the block to fill.
Then the pause can be caused by the driver allocating a supplementary block ?