From 5a74313b88ebde06dc4ea9bd21b2c97b2db92bd0 Mon Sep 17 00:00:00 2001 From: splis Date: Sat, 3 Feb 2024 16:29:07 -0500 Subject: [PATCH] speed up and memory leak fix --- js/brainchop/mainMeshNetFunctions.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/brainchop/mainMeshNetFunctions.js b/js/brainchop/mainMeshNetFunctions.js index 763767d..c218584 100644 --- a/js/brainchop/mainMeshNetFunctions.js +++ b/js/brainchop/mainMeshNetFunctions.js @@ -4151,6 +4151,7 @@ class SequentialConvLayer { // Important to avoid "undefined" class var members inside the timer. // "this" has another meaning inside the timer. + // *** WARNING!!! if you uncomment this line the memory leak will break webGL and may reboot your machine //document.getElementById("progressBarChild").parentElement.style.visibility = "visible"; return new Promise((resolve, reject) => { @@ -4208,7 +4209,8 @@ class SequentialConvLayer { if(chIdx == (self.outChannels -1)) { window.clearInterval( seqTimer ); - //document.getElementById("progressBarChild").style.width = 0 + "%"; + // *** WARNING!!! if you uncomment this line the memory leak will break webGL and may reboot your machine + // document.getElementById("progressBarChild").style.width = 0 + "%"; tf.dispose(outB); const endTime = performance.now(); const executionTime = endTime - startTime; @@ -4216,6 +4218,7 @@ class SequentialConvLayer { resolve(outC); } chIdx++; + // *** WARNING!!! if you uncomment this line the memory leak will break webGL and may reboot your machine //document.getElementById("progressBarChild").style.width = (chIdx + 1)*100/self.outChannels + "%"; }, 10); });