1

What are the major concerns when comes to browser memory utilization between javascript object and html dom.

var testArray = [1,2,3,4,5,6,7,8,9,10]

vs

<input type="text" id="textTextbox" value="test value"/>

When looking at big picture lets say the page has 10,000 html dom on page and a javascript object holding a huge number of record lets say 50,000

  1. Which utilizes more memory on browser
  2. How the memory is managed for javascript objects
  3. How the html dom is managed by browser

Please help..

Regards,

Navin Leon

1 Answer 1

1

Is there a practical reason for this question? I cannot imagine a reason why someone would want to manage data like this in real life.

My gut reaction is to say that a lot would depend on the browser environment. At the level you mean, there is no such thing as JavaScript memory management or DOM memory management that is separate from the browser's own memory management.

Remember, there are different rendering engines (WebKit, Gecko, Trident) for the DOM and different JavaScript engines (Rhino, JavaScriptCore, V8, IonMonkey) that implement the JavaScript runtime. These will all manage memory differently, with pros and cons to each.

Therefore, different browsers will manage the DOM and/or JavaScript differently. If you want to know the answer, I suggest conducting an experiment and measuring memory usage in the two contexts you describe across different browsers using diagnostic tools.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.