astroswell
Active member
Hello! When writing my script I've noticed that whenever I have to trigger repaint often(implementing zoom for example), memory consumption grows exponentially and never get garbage collected until the script is closed. Initially I copied the code from the NBRGBCombination script:
Apparently, it's due to the creation of the Graphics instance.
I've checked, it's happening in NBRGBCombination and BackgroundEnhance scripts, try to zoom extensively back and forth.
OS: Mac OS Catalina 10.15.7
PI: 1.8.8-7
I would call it pretty critical as it prevents from creating nice and smooth interfaces
Code:
this.ScrollControl.onPaint = function()
{
var G = new Graphics( this );
G.drawScaledBitmap( this.boundsRect, data.Preview.mainView.image.render() );
G.pen = new Pen( 0xFF00FF00 ); //Green
G.drawRect( this.imageRect() );
G.end();
};
Apparently, it's due to the creation of the Graphics instance.
I've checked, it's happening in NBRGBCombination and BackgroundEnhance scripts, try to zoom extensively back and forth.
OS: Mac OS Catalina 10.15.7
PI: 1.8.8-7
I would call it pretty critical as it prevents from creating nice and smooth interfaces