Answer the question
In order to leave comments, you need to log in
How to find a memory leak in JS code?
There are several lines of CSS, HTML,
and several functions like this on the page:
$(document).on('click', '#message', function(e){
$.ajax({
url: 'PutMessage',
type: "POST",
data: JSON.stringify({ data: $(this).val() }),
processData: false,
contentType: "application/json; charset=UTF-8"
})
.done(function(dataJson) {
$(this).val('');
});
return false;
});
Answer the question
In order to leave comments, you need to log in
Well, if the document is not to be peeled, then the full code is needed .... This post should not be eaten, unless a lot of data comes from the server.
It seems to me that chrome profiling can help you find your problem:
https://developer.chrome.com/devtools/docs/heap-pr...
Very useful thing. It will help to see the work with JS memory from the inside. For example, if you create one large string from several small ones, for example, var str = "a"+"b"+"c"+"d"; you will be surprised that the strings "ab", "abc" and "abcd" appeared in memory, although you did not order the first two. Given that the assignment only works for the last result.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question