• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Purging (Undo?) Cache

Participant ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

Hi!

I'm using scripts scripts to simplify repeditive tasks on complex files. My problem is that Illustrator is runing out of memory after a while and crashes after a while and to prevent this every 30 minutes I need to:

pause the script.

save the file (this takes a while, it's a complex file)

open the file

start the script.

I think it's the Undo cache that's acculminating the RAM.

So to my question:

Is there any way to either disable undos, or via script, flush the undo cache now and then?

Thanks!

TOPICS
Scripting

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 18, 2018 Jan 18, 2018

Depending upon what your script is doing it, and how it's doing it, it's unlikely that the undo cache is filling up or causing an issue. Most scripting commands do not create an undo state. Therefore, you could run a script that executes 1000 commands, and still only have one undo point. Some commands do create undo points (and i've made it a mission of mine to try to avoid these whenever possible), however. the app.executeMenuCommand() method creates an undo point in most cases. And also duplic

...

Votes

Translate

Translate
Adobe
Community Expert ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

Depending upon what your script is doing it, and how it's doing it, it's unlikely that the undo cache is filling up or causing an issue. Most scripting commands do not create an undo state. Therefore, you could run a script that executes 1000 commands, and still only have one undo point. Some commands do create undo points (and i've made it a mission of mine to try to avoid these whenever possible), however. the app.executeMenuCommand() method creates an undo point in most cases. And also duplicating any artwork from one file to another creates an undo point.

Memory leakage has been a problem for a while with scripting illustrator. Some methods for preventing, or at least minimizing, these issues are as follows.. Perhaps some others will jump in and share their successes in this area as well.

  • when batching files, you should open all the necessary files first, then execute your script's functionality, then close all of your files.
    • something about opening/processing/closing files one after the other exacerbates the memory issue.
  • declare your variables outside of loops.

I thought my list was going to be longer... anyway.. Taking these steps has had a profound effect on my workflow. Hopefully they'll help you as well.

If you want to try out the undo state thing, there's a setting in your Illustrator Preferences under the performance tab where you can change the number of undo states to keep. however, i think this fact nullifies your initial suspicion. there is a finite amount of undo states that you can keep.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 18, 2018 Jan 18, 2018

Copy link to clipboard

Copied

Hmm now when you gave me some insights I wonder if it might not be the undos after all, since after all the processing, if I ctrl+z, it puts me back to the beginning. Never thought of it.

It's a bummer that I couldn't set undos to zero, 50 is the minimum value, and my script causes a crash after about 30 loops 32GB ram filled to the brim. A zero value would put those "undo" concerns at rest completely.

I'm not doing anything all to crazy with the script, in short just duplicating and moving around a complex group, cropping it a bit, repeat 200 times.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 19, 2018 Jan 19, 2018

Copy link to clipboard

Copied

LATEST

There's a chance you're not doing anything wrong, the usual suspect is Illustrator. Post your code, we might be able able to spot the issue if any.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines