In the form, when I click the “click” button and then select “on” or “off” in the pop-up command, I’ve noticed that the heap memory keeps increasing continuously. I modified the code in table-view.js to monitor the heap memory, and the code is as follows:
Could this continuous memory increase cause the program to crash? Have you encountered similar issues before?
The content of the table-view.js file is as follows:
function bindEvents() {
$(“.item-cmd”).on(“click”, function () {
// show command dialog
simpleMemoryCheck();
let cnlNum = $(this).closest(“.row-item”).attr(“data-cnlnum”);
viewHub.features.command.show(cnlNum);
});
}
function simpleMemoryCheck() {
if (performance?.memory) {
const mem = performance.memory;
const used = Math.round(mem.usedJSHeapSize / 1048576);
const total = Math.round(mem.totalJSHeapSize / 1048576);
const percent = Math.round((used / total) * 100);
console.log(💾 memory: ${used}MB / ${total}MB (${percent}%));
if (percent > 85) {
console.warn(memory waring: ${percent}% Utilization rate);
}
}
}