JavaScript / jQuery memory usage within a browser
To what extent are jQuery / JavaScript functions stored in memory?
- Once the browser has parsed the page, does it go into memory? All of it? If functions are repeatedly called, are they always from开发者_如何转开发 memory?
- If the portion of memory allocated to scripts is filled (thinking Internet Explorer 6 on a horrible PC here), what happens? (Other than a slow browser...)
- Is there a way of seeing how much memory is used by a variable or a function as a whole?
As per my knowledge, once JavaScript code has been parsed by the browser, objects remain in the memory unless dereferenced and garbage collected. Garbage collection is dependent on the JavaScript implementation of the browser though.
You can see the memory usage by JavaScript objects easily in Chrome. See here.
精彩评论