Browser memory increases issue with 6 ajax call every second - ajax

I have my page in mvc which call 6 ajax request every second from javascript contineously and application is running 24/7 and after sometime memory get increasing and crash the application.I tried all the option that removing setinterval, makeing data null in success but it wont work. Can anyone help me for this queries.

Related

jqgrid is freaking out when gets 2 ajax calls

I am using jqgrid for my app and it works fine, I just have problem when the jqgrid gets 2 different ajax calls one by one but fast, I want it to just relate to the second ajax call, but it freaks out. Someone have an idea to resolve this?
i can't give a peek on the code, but i mean that he try to reload the data and meanwhile i press anther button and want him to reload anther data instead. i look at Fiddler and the 2 ajax calls gets fine
Kill the first request as a part of your second call. See Abort Ajax requests using jQuery as an example of killing an Ajax request.

AJAX long load hangs even on page refresh

I have a page that loads 2 drop down menu with AJAX. Then it loads a third AJAX that can take over 30 seconds to load. (slow SQL query).
When user selects items from the 2 drop downs the third slow AJAX is fired again to list the results.
All works fine on first load. But if I refresh the page or if user selects a different option while the third ajax is still loading, the page hangs until the third ajax has been loaded.
I have tried to .abort() the load, but that does not seem to help. The browser waits for the aborted file to load before loading ajax 1&2 and 3.
I added the abort to onbeforeunload but that does not help the page refresh problem.
I have tried this using pure JavaScript and jQuery but get same results.
The server is IIS6 and the XML output is from asp pages.
Is there any way to get around this?
Abort Ajax requests using jQuery
This should help you in aborting the ajax call. Just check on which ajax call you are actually calling abort() function.
On the side note, just check whether your browser is getting hung because of other processes running in your system. Because, every ajax request that is fired will start a db query and that may also give you a hung feel.

Ajax request during a file upload takes a long time to complete

I'm using a Webphere server. I am performing a file upload through a servlet using the Apache FileUpload methods.
I attach a listener to this FileUpload which updates a "percentage" field denoting what percentage of the request has been processed. The request gets directed to an iframe (form's target is an iframe) so that the page that fired the request doesn't have to wait for the response to complete and therefore it won't show the user just a blank page. I add a reference to the progress listener to the session as well.
From the JSP page as soon as I fire the submit on the form, after 1 second and then every second I fire an ajax request which goes to a servlet which looks up the ProgressListener and responds with the percentage field. The process works fine, but on Websphere sometimes this Ajax request can take up to 30 seconds to complete! I tested the same thing on a simple Tomcat server and there the request/response comes out within a second.
What could be wrong? Is it a server setting?
Thank you,
Edit: The code inside the servlet that gets the percentage from the session runs as soon as the request is made. The bottleneck seems to be in delivering the request back to the client browser.
Do you have websphere configured to compile and cache the jsp page, or is it recompiling each time?
You may want to use AOP, either AspectJ or Spring, or a profiler, to see what is going on with the ajax call, so that you can monitor without changing any code in the jsp page.
The profiler may be a better starting point, just so you can look globally at what is going on, then use aspects to monitor in a fine-grained fashion and decide where the bottleneck is.
You could also see if precompiling the jsp pages will help. This tutorial should be useful:
http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/index.jsp?topic=/com.ibm.commerce.samples.doc/tutorial/tdedeployjsp.htm

AJAX calls from multiple browser tabs at the same time:

When an user tries to send AJAX requests simultaneously from multiple browser tabs, the earlier requests get completed and the page loads but the other AJAX calls are preempted. AS a result of which the response is empty for the other calls. Only one call survives.
In my application using struts 2.0, JSP and javascript and the prototype framework, i found that the server response is empty in the cases mentioned above though the data gets updated in teh database with the request parameters. The onSucess event handler for Ajax.request gets called but the the response is empty.
Can you please help?
Thanks
I'm not quite sure what's happening to cause this, but here's one thing to try: The last large AJAX-centric application I developed, we had to add a random number parameter to each query string to ensure there was no caching on either the client or server side (or ISP side, these days).
Guaranteeing the query URL is different in each tab could solve your problem.
I think we should get ready status from Ajax call before starting making another call to server (except you were creating a new ajax object for each call), but i could be wrong.
I never use prototype, but i use Adobe Spry for years and have no problem with multiple Ajax call, but this one is for prototype, read this it should helpful.
Multiple Ajax Requests

Ajax updater not working in internet explorer

I have a problem with ajax updater that i couldnt solve.
I have this code Servicii
It works perfectly in firefox but in internet explorer it does nothing.Also if i open the site from my harddrive it works but it only works for the link once then i have to reload the whole page...
Does anybody have an ideea on how to solve this problem?
Thank you
I've had this exact problem. I'm assuming that you've got a function which periodically makes a request to the server to fetch data then updates the page if that data has changed since the last time you made the request.
Internet Explorer will cache the results of Ajax calls to the same resource even if you tell it not to in your HTTP headers. So if you make a request to get_data?id=whatever over and over again, IE will make the request once and then stop making it in the future and simply return the result of the first request.
The solution is to add a dummy parameter to the request string. So first you request get_data?id=whatever&ie_hack=0 then get_data?id=whatever&ie_hack=1 etc. This will stop IE from caching the results and force it to make the request each time, since it sees a different query string for each request.
I also ran into a problem like this, not with caching but with race conditions. IE executed the render part of the function before the any data was returned. Here's the issue, and solution:
Returned AJAX html breaks IE click events

Resources