Hi,
What is the size of x in your above example, using 1000x1000 works well for me.
Also did you forgot a not in your code sample above for the while loop condition?
Even after letting it run for a while, I still don’t get any problem.