Skip to main content
Known Participant
November 28, 2022
Question

Tips for investigating memory leak / bottlneck? (scripting / SDK)

  • November 28, 2022
  • 1 reply
  • 1344 views

Hey, wondering if anyone expert in the SDK can advise on an issue I'm having. 

 

First and foremost, I am using Python to automate workflows in Premiere using a package called Pymiere

 

I have a function that loops through an array of ~180 image paths, imports each, and places them on the timeline one at a time. The operation works, but is SLOW and gets slower and slower as the loop progresses, until it is basically at a standstill and I terminate the process. For what it's worth, the way Pymiere works is it basically compiles python into ES and sends it to a local server that controls Premiere.

 

The obvious inneficiency is that each call of the "insertClip" function is actually compiling a unique ES script and sending it to premiere. It is not a single batch call. But 180 individual calls. Memory management, "garbage collection" etc is beyond my current understanding, but it feels like it could be something to do with that.

 

I am hoping that this issue lends itself more generally to SDK troubleshooting and not specifically unique to Pymiere, but it may well be a Pymiere issue. In any event, I figure this community may have sone insights!

 

Does anyone have any thoughts on where a memory leak or bottleneck might occur in a workflow like this? Or how to even troubleshoot it? 

 

Thanks.

This topic has been closed for replies.

1 reply

Bruce Bullis
Legend
November 28, 2022

Other than insertClip(), what other PPro ExtendScript API calls are getting made, by each insertion? 


Known Participant
November 28, 2022

It looks like there is some reading / writing of ES code, and the following:

 

-line 77, checks that Premiere is running, which basically means:

      -checks for PID with the system

      -checks the Premiere "panel" to make sure it is reachable (post request to Premiere)

-line 97, sends code to premiere (post request to Premiere)

Bruce Bullis
Legend
November 28, 2022

Those seem like good specifics, but I don't see any ExtendScript calls, in/near those links; am I missing something?

What other ExtendScript calls are occurring, while importing and placing each of those ~180 images?