User:Mdaniels5757/chromeAutoGarbageCollect.js

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/**
 * @file This script just runs Chrome's garbage collector periodically.
 * (every wait_ms milliseconds (where wait_ms > 60000), to be exact).
 * Made because there's some sort of memory leak in one script/gadget or another
 * and I can't be bothered to figure out which.
 * The relevant Chrome flag must be enabled for this to work.
 * 
 * @copyright Copyright 2020 Michael Daniels (Wikipedia User:Mdaniels5757)
 * @license Your choice of CC-BY-SA-3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode) and Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
 */ 

var wait_ms = 61000;

function runGC() {
	window.gc();
	
	setTimeout( function () {
		runGC();
	}, wait_ms);
}

runGC();
Retrieved from "https://en.wikipedia.org/w/index.php?title=User:Mdaniels5757/chromeAutoGarbageCollect.js&oldid=968695154"