Loading

Error 'Java Heap Space' in Data Loader

Data pubblicazione: Oct 13, 2022
Descrizione


You can resolve or prevent 'Java Heap Space' errors by lowering the batch size setting in Data Loader.

 


Notes:

 
  • Dataloader runs on Java, and the issue occurs when the JVM runs out of the memory allocated to it when executed.
 
  • From Dataloader version 21 onwards, the heap size is more restrictive than previous versions, which is why the issue was less likely to occur in previous releases.
 
  • Newer Dataloader versions (45 and up) that use Zulu Java manage heap size differently and should not need to do this.
 
  • In some scenarios (eg. when extracting attachments), it is occurring due to the nature of the content being downloaded, which would increase the amount of required memory on the local system (JVM).
 
  • Starting from Data Loader version 21.0 and higher, the behavior of the Data Loader has been changed, and the heap size is not set high any more.
 
  • The general (and most common) use case for Data Loader is to export (or import) rows of data (strings, number etc.) from an org, which have a much more modest memory requirement.
 
  • It is very difficult to define a heap size that would be suitable for all user scenarios, while still keeping its memory footprint and requirements modest.
Risoluzione

 

The preferred solution is to:

 
  • Lower batch size in Data Loader's Settings to as low as possible, preferably 1. Please review Configure Data Loader for more details.
 
  • Ensure that you have installed and are using the most recent version of Data Loader.


Alternatively, it may be possible to increase the java heap size for the Data Loader startup command. The details below assume that Data Loader is installed in the default location. If Data Loader is installed in a different folder, then the startup command below will look differently.

 

a)  If you have Data Loader shortcut on the Desktop, right-click the shortcut, select properties from the menu that opens, and in the target field modify it to look like this:

"C:\Program Files (x86)\salesforce.com\Data Loader\Java\bin\javaw.exe" -Xms1024m -Xmx1256m -Dappdata.dir="C:\Users\<user>\AppData\Roaming" -jar "C:\Program Files (x86)\salesforce.com\Data Loader\dataloader-26.0.0-uber.jar" 

where <user> is the username of the User of the machine.

For Data Loader Version 37 on Windows 7, the path might look like:

"C:\ProgramData\Oracle\Java\javapath\javaw.exe" -Xms1024m -Xmx1256m -Dappdata.dir="C:\ProgramData" -jar "C:\Program Files (x86)\salesforce.com\Data Loader\dataloader-37.0.0-uber.jar"


b) If you do not have Data Loader shortcut on the Desktop, then click on Start Button>All Programs>salesforce.com>Data Loader and right click on the Data Loader icon there, select Properties from the popup menu that opens, and follow the steps described under a).
 


It might be required to go through several iterations of the steps above to find the right heap size. When setting the heap size the total amount of memory present on the system must be taken into account. Also if the system run 32 bit OS, then the heap size cannot be bigger than 2 GB. Please refer to the Java documentation for more details.

Numero articolo Knowledge

000385819

 
Caricamento
Salesforce Help | Article