javascript - Memory impact of assigning a new value to global variable -


what happens when global variables reassigned new values - old memory safely released or leaked?

for example,

gui = {};  function myfunc1() {    gui.selecteditem = new bigarray(1000); } function myfunc2() {    gui.selecteditem = new bigarray(1000); } function release() {    gui.selecteditem = null; } 

would safe call myfunc1() , myfunc2() 1 after other immediately, or assign variable null first (before reassigning large object)?

i purely interested in memory pressure , concerned variable leaking old memory when new value assigned new.

javascript uses garbage collector reclaim memory of objects not accessible variables. old memory released automatically.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -