Skip to main content
Solved

Is There a Size Limit for PDFs in the 'Extract Image' Action? Facing Java Heap Space Error with Large Files

  • May 22, 2025
  • 5 replies
  • 63 views

Om Keskar
Navigator | Tier 3
Forum|alt.badge.img+6

Is there a size limit for the PDF when using the 'PDF: Extract Image' action?
Whenever I try to use a PDF larger than 1MB, it throws a 'Java Heap Space Error.'
 

Type of image to be converted to: JPEG

JPEG Quality: 100

X and Y resolution (dpi) :200

Best answer by Om Keskar

Hi,

If you're facing a similar issue, you can try increasing the Java heap space using the Command Line Interface.

First, check the currently assigned memory with the following command:

java -XX:+PrintFlagsFinal | findstr "HeapSize"


To increase the heap size, use:

SETX _JAVA_OPTIONS "-Xmx2048m"

  • Use 1024 for 1GB

  • Use 2048 for 2GB

After making the change, run the first command again to verify that the new heap size has been applied. This should help resolve the issue.

In my case, I was unable to process PDFs larger than 1MB when the heap size was set to 512MB. After increasing it to 1024MB, I was able to process PDFs over 10MB without any problems.

Note: Avoid increasing the heap size too much, as it may negatively impact the performance of your system or bot.

Thanks,
Om.

5 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • May 22, 2025

I tried this with a 4.22MB PDF file, single page, 600 DPI scan of a photo. I was unable to replicate the error you reported.

Is this a PDF you can share? You can send it to my email at aaron.gleason@automationanywhere.com to see if I can replicate your results.


rbkadiyam
Premier Pathfinder | Tier 7
Forum|alt.badge.img+17
  • Premier Pathfinder | Tier 7
  • May 22, 2025

@Om Keskar 

You can increase java heap space with below two options 
 

Solution 1 :
Steps to follow : 

  1. Edit the “nodemanager.properties” file under “C:\Program Files\Automation Anywhere\Bot Agent\config” 
  2. Add this line to configure more heap memory  bot.launcher.jvm.options=-Xmx4096m  
  3. Restart the bot agent service.

Solution 2: 
Steps to follow :
1. Login with admin user in A360 Control Room.
2. Go to Administration > Settings > Devices > Advanced Options and click edit.
3. Add the below string under "Bot launcher JVM options" including double quotes :
"-Xmx8192m"


Lu.Hunnicutt
Pathfinder Community Team
Forum|alt.badge.img+19
  • Pathfinder Community Team
  • May 27, 2025

@Om Keskar Were you able to get this to work?


Om Keskar
Navigator | Tier 3
Forum|alt.badge.img+6
  • Author
  • Navigator | Tier 3
  • May 28, 2025

@Om Keskar Were you able to get this to work?

This solution didn’t work, but I found another one that worked for me.


Om Keskar
Navigator | Tier 3
Forum|alt.badge.img+6
  • Author
  • Navigator | Tier 3
  • Answer
  • May 28, 2025

Hi,

If you're facing a similar issue, you can try increasing the Java heap space using the Command Line Interface.

First, check the currently assigned memory with the following command:

java -XX:+PrintFlagsFinal | findstr "HeapSize"


To increase the heap size, use:

SETX _JAVA_OPTIONS "-Xmx2048m"

  • Use 1024 for 1GB

  • Use 2048 for 2GB

After making the change, run the first command again to verify that the new heap size has been applied. This should help resolve the issue.

In my case, I was unable to process PDFs larger than 1MB when the heap size was set to 512MB. After increasing it to 1024MB, I was able to process PDFs over 10MB without any problems.

Note: Avoid increasing the heap size too much, as it may negatively impact the performance of your system or bot.

Thanks,
Om.