Can it occur at all, that it crashes cause of lack of memory?
If yes, is it possible to manage it somehow? (increase more RAM for the program or delete some variables, which are not using more at runtime or there is some garbage collector)?
Nothing much you can do about it, except for try to optimize your code. Unfortunately, Acrobat has a very bad memory handling mechanism and tends to choke or crash when executing very tasks.
Thank you! Yeah, I optimized where possible some operations. I figured out that this function (this.getOCGs()) uses a lot of memory. So in one of my cases I copied the layer name to my own array for later usage.
You can also use a variable to hold the OCGs array, so you wouldn't need to access them directly each time, for example.
Do you mean, something like this: var ocgsArray = this.getOCGs(); ?
Could I change/get the properties of each layer on such a way as well?
1. ocgsArray.state = false;
or get the name :
2. var layerName1 = ocgsArray.name;
I believe that should work, yes.
Thanks! I'll try.