Copy link to clipboard
Copied
Hello!
I have a data exporter script, that reads all the info I need from my project and export that to an external JSON file.
My project is quite big and every time I run my script it takes more time to finish than the time before, even if I didn't had anything new, a minor change of color or something else is enough. It starts taken 9sec and after a few runs it takes some minutes, which is so boring!
And if I close AE and open it again, it seems that something was cleared up and it is fast again, and take again 9sec to finish.
So, what I want to know is if there is any command that I can run on my script that produces the same result as close-open AE?
(I don't know what it does, but I guess some kind of memory/data clean, no?)
Copy link to clipboard
Copied
Refer to the purge and cahce cleaning commands in the edit menu.
Mylenium
Copy link to clipboard
Copied
Tried all that, none made effect 😞
Copy link to clipboard
Copied
Using the ExtendScript toolkit I can data browser, and there is a lot of stuff from javascript there, maybe it is something about it, no?
Is there any way to clear that?
Copy link to clipboard
Copied
Hard to tell without seeing your code, but sounds like you're creating global variables that aren't getting cleaned up on each run. Make sure all your code (especially data-heavy segments) are wrapped in a functions or IIFE statements, that way when they're done running they get cleared out of memory and don't bog stuff down. Another thing to check for is that you're closing your files after opening them.
Copy link to clipboard
Copied
Yes, about closing files I'm already doing it.
About global vars, I have some, but nothing heavy, just a few strings and numbers for config.
But just in case, I put all my code inside an IIFE, but nothing changed, it takes several time to complete 😞
Copy link to clipboard
Copied
Are you declaring all your variables with var? If you don't they'll leak to the global scope.
Also, you can monitor your memory usage with Task Manager / Performance Moniter to see if your RAM is in fact making out, or if it's something else.
Copy link to clipboard
Copied
Yes, I'm using var everywhere.
I monitored the memory consumption and at each time memory increases, yes.
Also, I tried to purge all memory and cache from AE menus, and in that momento memory went down but right after click back on AE window, memory values get back to where it was before the purge action.. weird, no!?
Copy link to clipboard
Copied
Strange, well there's gotta be some variable not getting cleaned up somewhere so I'd keep looking and testing sections of code. You could purge memory programmatically with executing a command ID.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more