Reputation: 3265
To simplify my problem I suppose that I have an application that turns on intranet on the client. I suppose that the application has one single page and I am using ajax to interact with the server. I am using ajax for instance to download byte files (3Mo for each byte file as ajax object response from server), these byte files are drawn on canvas later on.
My questions are
1- Where are located these object response, is it on RAM, or hard disk?
2- If it is on RAM: When I do the second ajax call to download other files, I notice that my browser memory usage goes higher with every call, how can I clear these old objects response downloaded?
PS: I am sure they are stored somewhere because I can see old ajax response objects when I press F12 on the browser and I go to Network section. Thank you in advance and sorry for my English.
Upvotes: 2
Views: 1044
Reputation: 3265
Some people vote to close but sometimes they don't take time to read the question they just link to old links from 2009 thinking they answered your question, or perhaps I was not clear enough, anyway, I found out the problem of why my memory goes up, for those who had or will have the same problem, I was using some methods of jquery that leads to memory leaks.
How I discovered the problem :
I deleted all the instructions that occur after receiving the ajax responses, I only left the ajax calls. Result => No memory leaks
for(i=0;i<120;i++){ //am not using the 'for' loop, it is just an example $.ajax({
}).done(function(){
// i deleted all this
});
}
So the problem occurs with my code. Elimination principle : I started to delete line by line to figure out which line causes the problem : Result => .append() and html() leads to memory leaks , so i replace them with javascript innerHTML or appendChild() js => problem solved
Upvotes: 4