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

<cfdocument> PDF limit

New Here ,
Jul 07, 2015 Jul 07, 2015

Copy link to clipboard

Copied

     Hi guys,I'm trying to create multiple pdfs with <cfdocument> tag inside a loop.When I say multiple pdf files , the counter could reach up to 1500 files.The result should be a zip with all the files .

    The problem is that after a while the request crashes because of : java.lang.OutofMemoryError : java heap space .

    My question is : has coldfusion a limit in generating <cfdocument> pdf files? I tried also , to break all this action into multiple threads , putting only 100 pdf files on a thread, but even so some of the threads ended with java heap space error.

     Have anyone of you encountered this problem before ? Any tips or help it will be gratefully apreciated.

     Best Regards,

      George T.

Views

992

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 , Jul 07, 2015 Jul 07, 2015

There's no limit, that I know of, for the number of PDFs you can create.  However, the Java heap space error means your server is running out of memory.  This could be a multitude of issues.  Are you saving all the PDFs in memory or saving them to your RAM drive in the loop?  If the documents are of considerable size this will eat up your memory real quick.

Can you allocate more memory to CF?  How about writing the PDFs to disk in the loop?  A "last resort" option I've used before in similar situ

...

Votes

Translate

Translate
Engaged ,
Jul 07, 2015 Jul 07, 2015

Copy link to clipboard

Copied

There's no limit, that I know of, for the number of PDFs you can create.  However, the Java heap space error means your server is running out of memory.  This could be a multitude of issues.  Are you saving all the PDFs in memory or saving them to your RAM drive in the loop?  If the documents are of considerable size this will eat up your memory real quick.

Can you allocate more memory to CF?  How about writing the PDFs to disk in the loop?  A "last resort" option I've used before in similar situations is setting up a META refresh to reload the page while processing only a few items at a time (this doesn't work if using scheduled tasks, of course).

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
New Here ,
Jul 08, 2015 Jul 08, 2015

Copy link to clipboard

Copied

Thank you for your quick response. I managed to fix the problem by increasing the heap memory  on my Coldfusion server(how you suggest) ,also I optimized the loop(which is a query) and the size of the documents(only 100 KB for a pdf file).

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 ,
Jul 11, 2015 Jul 11, 2015

Copy link to clipboard

Copied

LATEST

Great! Please mark your answer as the correct one.

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
Resources
Documentation