Answer the question
In order to leave comments, you need to log in
Freeing memory in JS
Good evening, I load images in base64 and use js to insert the img element into the page, while it's all one element, just the picture is updated. Faced with the problem that the memory is growing, and the browser eats a lot of it, tell me how you can clear the memory in this situation? I tried to remove the picture from the dom model, it did not help.
Answer the question
In order to leave comments, you need to log in
Post an example of your code on jsfiddle. A spherical example of freeing memory is as follows:
var image = "BIG DATA";
$("#container").append(image);
image = null;
document.getElementById('image').innerHTML = ''
remove(), empty(), html()
helps avoid leaks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question