I am using General Interface in my web application and I have javascript classes and methods to create objects for my classes. I would like to clear the memory when the objects are not used. My question is how can I clear the object's memory.
I have tried with 'obj = null;' and 'delete obj;'. Both are not working as expected.
Is there way to clear the object and object memory in JavaScript or in General Interface.
-Sridhar
You can't. As long as every reference is really removed (e.g. setting to
null
as many have suggested), it's entirely up to the GC as to when it'll run and when it'll collect them.