I was wondering does anyone know what are the limits of dom for example.
If I have a json object
var json = {}
and this json object had its own objects inside, including arrays,other objects, or event plain text.
how many child objects can json hold if there is a limit, and also what if the object was dynamically increased in size would this ever display an error? because there is no more memory to handle it etc…
I don’t believe there are hard limits, but I was curious to see what would happen, so I wrote a little ad hoc test script:
The script builds a giant array. In each iteration, a smaller array is created with 10,000 objects and pushed to the main array. Each object contains 5 members: 2 numbers, 2 strings and 1 date. I count the number of iterations.
I tested this script on two computers, except for IE7 and IE8 for which I only had one computer available. The first computer runs Windows XP with 2GB ram, the second computer runs Windows 7 with 4GB ram.
I got the following results: