Home     |      Learn AJAX     |      Forum     |      Register     |      Submit Resource     |      Submit Article      |      Contact Us

Home JavaScript
 

Garbage Collection Reference Functions

 

Garbage collection in JavaScript is basically a process wherein the memory and the cached data in an Ajax based application are removed. This should be effectively implemented in JavaScript and Ajax based applications so that processes will still perform as expected.


If the memory or the data cached will be continuously stored in the browser, the browser will ultimately slow down or even stop the process. Through efficient garbage collection, developers will be able to implement a smart Ajax based application that can effectively work with major browsers.


The common trick developers use to ensure smarter garbage collection is to create functions that will shed stored data as soon as they used. Through this process, developers will be able to remove temporarily stored data without slowing the application. This will require additional coding because of the functions created to remove the temporarily stored data.


The process of creating functions to remove temporarily stored data is a common and proven technique to remove stored data. However, there are actually functions related to JavaScript that will naturally increase data storage and will require more memory from the browser and ultimately, in the local gadget.


The function usually implemented that naturally requires additional memory from the browser and gadget is the reference function. The reason for the additional requirement of memory is simple: reference functions will seek additional functions and data before they are implemented. Because of that requirement, the browser and the gadget will have to provide additional resources.


The following are functions related to reference that may have some effect in memory as well as garbage collection:


ReferenceString - developers have to be very careful in using this function since this will increase the memory usage in the browser. As the name suggests, the function will search for additional string that should be implemented along with the function.


NoExternalReference - fortunately, this function will not affect in anyway the current configuration of the application. No memory increase will be required since no additional reference will be asked. This function is placed along with references to prevent the system from seeking additional references.


UndefExternalReference - the extent of memory usage in this function depends on the "undefined" string in the application. If the undefined string comes with various functions then memory increase is required. But when the "undefined" in the application is simply a variable, then developers do not need to increase the required memory.


NoExternalReferenceWithEval - as the name of the function suggests, this function will only ask for external reference if there's an eval added on the function. This is often implemented to double check the security of the reference to avoid intrusion or attacks.


NoExternalReferenceWithWith - Just like the previous function, possibility of additional required memory and garbage collection depends on how they will be used.


Note

: NoExternalReferenceWithEval and NoExternalReferenceWithWith can intrude the garbage collection functions in the application. It's highly recommended to double check the output or tests the application's garbage collection after these two functions are implemented. They are not necessarily intrusive but they can have some effects in garbage collection.



Read Next: JavaScript Void Operator



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links