Frequent AJAX-requests slow down browser

Posted on 2009-04-16
Last Modified: 2013-11-19
We have implemented an administration interface in AJAX, which shows a realtime "live log" of events (read from a mysql DB). The interface shows only the last e.g. 100 recent events.

i'm told that after heavy usage for about an hour (without a complete page reload, only AJAX requests), the interface/browser becomes slower and slower, sometimes even crashes.

This might be due to more and more data being accumulated (in the browser cache?) and not properly cleaned up.

(How) can i avoid this anyhow? How do other realtime-system powered by AJAX (chats?) solve this issue?

Or is it something else?
Question by:thomers1
    LVL 20

    Expert Comment

    depending on how you implemented your page the following can occur.

    The div, table whatever you are using is filling up with more and more text --> Display only the newest and remove older entries when adding new ones.

    The request/response data is not invalidated and is kept in memory --> Throw away old request/response objects.

    What framework are you using for your ajax or are you doing all by yourself?
    LVL 12

    Expert Comment

    Does this issue happen in Firefox and IE, or only IE?

    Can you post some code? It's possible that your code structure is preventing garbage collecting from happening which over time could start to cause performance issues.

    Author Comment

    we only use FF for the admin interface.

    we are using mootools and mochaUI

    > The request/response data is not invalidated and is kept in memory -->
    > Throw away old request/response objects.
    how do you check and ensure that its properly thrown away?


    Author Comment

    update: or should we prefer to rewrite this using some other technology? flex maybe?

    Accepted Solution


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
    I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now