Monitor with Interval filling heap memory

This issue has been tracked since 2022-06-21.

Is there any methods to stop interval on monitor rather than setting a timer by myself and calling update manually?
image
this is heap before page close
image
this is when I open page again
Before those monitors everything worked fine (without memory leak)

cocopon wrote this answer on 2022-07-08

How about passing interval: 0 to the monitor:
https://cocopon.github.io/tweakpane/monitor-bindings.html#interval

Jor-ban wrote this answer on 2022-07-08

How about passing interval: 0 to the monitor

In this case graphs are just not rendered, timeout works still, so it doesn't fix my problem
I've tried to dispose them, but, it doesn't remove interval

cocopon wrote this answer on 2022-07-08

Ah sorry, I may not have understood the situation correctly. You want to stop a monitor manually, right?

Jor-ban wrote this answer on 2022-07-08

yes

cocopon wrote this answer on 2022-07-08

You can use disabled property of the monitor:

const params = {foo: 0};
setInterval(() => params.foo = Math.random());

const pane = new Tweakpane.Pane();
const m = pane.addMonitor(params, 'foo', {
  view: 'graph',
  max: 1,
});

// This stops updating the monitor
m.disabled = true;
Jor-ban wrote this answer on 2022-07-08

image
I guess It won't be such easy :)

cocopon wrote this answer on 2022-07-08

Hmm it's strange, BladeApi has a setter for disabled:
https://cocopon.github.io/tweakpane/api/classes/index.monitorbindingapi.html#disabled

It works fine for me so may be caused by your environment:
https://codesandbox.io/s/tweakpane-sandbox-forked-18hong?file=/src/index.js

Jor-ban wrote this answer on 2022-07-08

Oh thank you for help, I guess you are right, and its caused by environment

More Details About Repo
Owner Name cocopon
Repo Name tweakpane
Full Name cocopon/tweakpane
Language TypeScript
Created Date 2016-05-10
Updated Date 2023-03-17
Star Count 2603
Watcher Count 19
Fork Count 71
Issue Count 11

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date