Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  15 Nov 2019, Andreas Suter, Suggestion, javascript comunication 
    Reply  15 Nov 2019, Stefan Ritt, Suggestion, javascript comunication 
       Reply  17 Nov 2019, Konstantin Olchanski, Suggestion, javascript comunication 
          Reply  18 Nov 2019, Stefan Ritt, Suggestion, javascript comunication 
             Reply  18 Nov 2019, Konstantin Olchanski, Suggestion, javascript comunication 
    Reply  17 Nov 2019, Konstantin Olchanski, Suggestion, javascript comunication 
       Reply  18 Nov 2019, Stefan Ritt, Suggestion, javascript comunication 
Message ID: 1740     Entry time: 18 Nov 2019     In reply to: 1737
Author: Stefan Ritt 
Topic: Suggestion 
Subject: javascript comunication 
> a) google chrome slows down the execution of javascript in inactive tabs, leading to trouble
> with memory management - midas pages poll at 1/sec, each poll allocates memory for processing RPC messages,
> and (until recently) allocates memory for new DOM objects to update the web page - but the garbage collector
> gets slowed down and does not keep up - leading to huge memory use (up to 200 Mbytes) for inactive midas pages
> that normally consume 50-ish Mbytes.

Try my latest change, which drops any update if hidden, except the alarm sound. At the moment this only works on the main "status" page.

> most midas web pages poll in two places - mhttpd_refresh() updates the current date timestamp, alarms, currently active midas.log message;
> and each page has it's own loop for updating it's own data (i.e. "alarms" page, "programs" page).

That's correct. I changed mhttpd_refresh() now and the main loop for the "status" page. If that works for everybody, we can do that also for "programs" and other pages. The code is here:

      if (document.hidden) {
         // don't update page if hidden
         setTimeout(update_page, 500);
         return;
      }

where "update_page" has to be replaced with the proper function.

Stefan
ELOG V3.1.4-2e1708b5