Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak with ScriptClip? #340

Closed
Dogway opened this issue Feb 27, 2023 · 3 comments
Closed

Memory leak with ScriptClip? #340

Dogway opened this issue Feb 27, 2023 · 3 comments

Comments

@Dogway
Copy link

Dogway commented Feb 27, 2023

Runing several ScriptClip with propSet() calls inside them, causes a constant raising of RAM. This is worse the more inter-filtering you are performing between the ScriptClips:

ex_smooth() # or any other filter
a=last
ScriptClip(function[a]() {
propSet("_DurationDen",propGetInt(a,"_DurationDen")*2)
propSet("_DurationNum",propGetInt(a,"_DurationNum")  )
} )
a=ex_smooth()
ScriptClip(function[a]() {
propSet("_DurationDen",propGetInt(a,"_DurationDen")*2)
propSet("_DurationNum",propGetInt(a,"_DurationNum")  )
} )
a=ex_smooth()
ScriptClip(function[a]() {
propSet("_DurationDen",propGetInt(a,"_DurationDen")*2)
propSet("_DurationNum",propGetInt(a,"_DurationNum")  )
} )
a=ex_smooth()
ScriptClip(function[a]() {
propSet("_DurationDen",propGetInt(a,"_DurationDen")*2)
propSet("_DurationNum",propGetInt(a,"_DurationNum")  )
} )

When the ScriptClips are commented and only the 4 filters are kept the RAM is steady.

@pinterf
Copy link

pinterf commented Feb 27, 2023

Thanks for the report. It won't be easy, I think. If there is initially a frame property defined and there is a runtime function inside ScriptClip, then it leaks. Totally weird.

Colorbars(staticframes=false, pixel_type="YV12")
propSet("anything",30) # Line#1
ScriptClip(function[]() {
x = 1.0
x = AverageLuma(last) # Line#2
Blur(x/255.0)
} )
# leak: if both #1 AND #2 exists

@Dogway
Copy link
Author

Dogway commented Feb 27, 2023

Nice you could narrow it down. No problem, just wanted to let you know, I added some knobs inside QTGMC+ to skip runtime frameprop assignment and fixed my issues.

In any case your example is more worrying as it's a more generic case. Like for example set "_FieldBased" to 0 after TIVTC and later in the script chain any kind of ScriptClip call...

@pinterf
Copy link

pinterf commented Mar 1, 2023

Status report: problem found and seems to be fixed, I hope I can clean it up this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants