Note that there are some explanatory texts on larger screens.

plurals
  1. POJavaScript Memory Leak Issue
    primarykey
    data
    text
    <p>I am working on a piece of code that has a substancial memory leak, I am posting an example function but my entire 11,000 line code has similar functions repeated all over. I am experiencing an average of 5Mb memory leak when I click the Refresh Button. The logic behind the refresh button is to call the empty function of the object. I have researched all over for cyclic references and closures but I am not really sure if the way I set everything to an empty array is correct or should I set everything to null ? Any help would be great. I have to use IE as the app is on IE. Sadly no chrome tools for me :( </p> <pre class="lang-js prettyprint-override"><code>/** * Represents the tasks for the currently loaded patients. */ var foo = { loaded: false, overdueTaskCounts: [], unscheduledTaskCounts: [], currentTaskCounts: [], scheduled: null, patientTasks: {}, tasks: {}, taskNumber: 0, /** * Unpacks the JSON received from the CareCompass service for the CareCompass task counts. * @param reply - The JSON representing the data returned from the CareCompass service. */ unpack: function unpackTasks(reply) { var taskCounts = reply.data; * * //This function populates the variables declared above**// this.scheduled = taskCounts.scheduled; }, /** * Removes all the task information related to the loaded patients. * @param none */ empty: function emptyTasks() { this.loaded = false; this.overdueTaskCounts = []; this.unscheduledTaskCounts = []; this.currentTaskCounts = []; this.scheduled = null; this.patientTasks = {}; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload