skip to Main Content

Problem -Browser Out of Memory

I am in charge of a browser (Edge) tab that runs a Grafana dashboard playlist 24/7 to track stats. After an unpredicted period of time, the tab will show the "Out of Memory" error page, while all the other tabs are working fine. After refreshing the page, everything will work perfectly again.

Current Solution

Since upgrading Grafana to fix the suspected issue "memory leak on Grafana" is currently unfeasible due to company policy.

To fix this, I have to manually refresh the page by clicking the refresh page button. Is there any way to automate this behavior or to avoid/prolong this "out of memory" issue arising?

Attempts

By inserting JS code into DevTools > snippets. I can successfully reload the page into the playlist using window.location.assign(). Yet, the JS script will stop running after the page has been reloaded and thus setInterval() to reload the page from time to time is not working, meaning I can only auto-reload it once.

I have searched the web for answers on JS code insertion, but due to company policy, extensions like Tampermonkey and such are forbidden. Is there any solution to this? Whether it is storing the JS code and running it elsewhere or perhaps reloading the page using other methods.

2

Answers


  1. Go to chrome web store and get this extension

    https://chromewebstore.google.com/detail/auto-refresh-plus-page-mo/hgeljhfekpckiiplhkigfehkdpldcggm

    this is all you need , install it and set desired time interval to refresh page

    alternatively just save this html file and open it in browser (replace time and url according to you) ( No Extension Needed )

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <script>
            onload = () => setTimeout(() => {
                location.reload();
            }, 1000) // Set You Desired Time in MilliSeconds
        </script>
        <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body{
            height: 100vh;
            width: 100vw;
            display: flex; 
        }
        iframe{
            height: 100%;
            width: 100%;
        }
        </style>
    </head>
    <body>
        <iframe src="https://google.com" frameborder="0"></iframe> <!-- Your Website Link -->
    </body>
    </html>
    
    Login or Signup to reply.
  2. The best way would be to put the reload logic in the code itself. But in lieu of that, you could open another tab and open the url you want through the console using the window.open function. With that you can put the opened tab in an setInterval to reload every 10 minutes like this:

    newTab = window.open("https://www.urltodashboard.com");
    
    timer = setInterval(function(){newTab.location.href="https://www.urltodashboard.com"},10*60*1000);
    

    Replace the url above with your dashboard URL.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search