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

ExtendScript limit on how many paragraphs can be processed

Community Expert ,
Feb 07, 2018 Feb 07, 2018

Copy link to clipboard

Copied

I received a bug report on my FindChangeFormatsBatch ExtendScript script yesterday where the issue was a crash on two particular documents. Both documents contain a large amount of tables and, because each cell contains at least one paragraph, a large number of paragraphs. One document had over 12,000 paragraphs and the other over 14,200 paragraphs.

I still wasn't sure if the number of paragraphs was the problem so I set up a simple, Portrait document containing a large number of paragraphs. Each paragraph was empty except for an autonumber so I could keep track of the number of paragraphs. Here is the code I ran:

#target framemaker

var doc = app.ActiveDoc;

countPgfs (doc);

function countPgfs (doc) {

   

    var pgf, counter = 0;

   

    pgf = doc.FirstPgfInDoc;

    while (pgf.ObjectValid () === 1) {

        counter += 1;

        pgf = pgf.NextPgfInDoc;

    }

    alert (counter);

}

The code always ran the first time, even with over 14,000 paragraphs in the document. But it would hang and crash FrameMaker if I tried to run it a second time. I cut my paragraph count back until I could run it over and over without hanging. I ended up at around 12,200 paragraphs, give or take a few. Once I got over that mark, FrameMaker would hang on the second run of the script.

I wonder if anyone else has experimented with ExtendScript and processing large numbers of paragraphs. Any feedback or comments will be appreciated.

-Rick

TOPICS
Scripting

Views

886

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

Engaged , Feb 08, 2018 Feb 08, 2018

This is a Memory leak in ExtendScript Core and related to all Adobe Products using ExtendScript.

This doesn't effect FDK Clients/plugins and so this has no side effects to FrameScript.

Hopefully Adobe will solve this Problem very soon. Traversing all paragraphs in a document is a very common use case.

Votes

Translate

Translate
Enthusiast ,
Feb 07, 2018 Feb 07, 2018

Copy link to clipboard

Copied

Hi Rick,

this is a known bug.

Re: Framemaker 12 and Framemaker 15 get stuck after one complete traversal of all Paragraphs in the ...

I've tested it several times. After about 500 Pgfs FrameMaker crashes.

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 ,
Feb 08, 2018 Feb 08, 2018

Copy link to clipboard

Copied

Thank you Klaus. I forgot about that thread. I have a lot of scripts that completely traverse all paragraphs that don't stall, except when the number of paragraphs gets large.

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 ,
Feb 08, 2018 Feb 08, 2018

Copy link to clipboard

Copied

Hi,

Is this bug also in FrameScript or only in ExtendScript?

Best regards

Winfried

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
Enthusiast ,
Feb 08, 2018 Feb 08, 2018

Copy link to clipboard

Copied

Hi Winfried,

I suppose, that it's only in ExtendScript.

Because @Stefan_Gentz wrote (see my link above)

We have investigated this further, and this bug is in ExtendScript and not FrameMaker.

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
Engaged ,
Feb 08, 2018 Feb 08, 2018

Copy link to clipboard

Copied

This is a Memory leak in ExtendScript Core and related to all Adobe Products using ExtendScript.

This doesn't effect FDK Clients/plugins and so this has no side effects to FrameScript.

Hopefully Adobe will solve this Problem very soon. Traversing all paragraphs in a document is a very common use case.

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 ,
Feb 08, 2018 Feb 08, 2018

Copy link to clipboard

Copied

Thank you guys for clearing this up. Just to clarify: I have hundreds of ExtendScript scripts that traverse all of the paragraphs in a document and these normally work without failure. The failure comes when the number of paragraphs in the document is large, somewhere around 12,000 or so. Thanks again!

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
Engaged ,
Feb 08, 2018 Feb 08, 2018

Copy link to clipboard

Copied

LATEST

open Taskmanager and see what happens....

Memory increases and perhaps on 12,000 pgfs it crashes as Memory Limit for 32bit applications is reached.

May be it happens with 5,000 pgf if your scripts allocates Memory for other objects (markers) in same run.

In my experience Memory is deallocated again, when script is finished.

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