0

So, I am running a javascript program that renders an image of the mandelbrott set, but when ever I crank the number of pixels in width up to past around 3000, half way through chrome crashes and says Error Code: SIGILL. This means invalid instruction which tells me that it is not my problem, but the actual browser. I do believe that I have narrowed down the problem to the double for loop in the code. Once it reaches around 10 000 000 iterations (which is about 10 000 000 pixels) it crashes. This is when I set bitCount to around 3 100. One thing I noticed is that it draws all of the pixels on the screen once it has gone through calculating everything at once. Do you think maybe it exceeded space on the javascript cache/memory and it can not calculate anymore pixels. I know that it is the for loop by the way because when I increase the length of each row (to 4000 for example) it can only calculate about 2100, but when I decrease it to 3500 it can calculate, for example, 2900 of the rows. I am wondering if you have any idea what the problem might be and if my thought process is correct. Also, how can I go about fixes this, so that I can get higher resolution images and I can zoom deeper into the fractal?

Here is the code. You need to run mandelbrott2b.html. https://www.dropbox.com/sh/g3pejrn9kviajiw/AADVigDeKI1b-7cyCN29c-1ia?dl=0

Anonymous Asked question May 13, 2021