开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜