Salesforce Data Loader runs on the Java Virtual Machine (JVM). A "Java Heap Space" error occurs when the JVM runs out of the memory allocated to it during a data operation (such as an import, export, or attachment download).
Reducing the batch size is the most effective and recommended fix for Java Heap Space errors.
For detailed configuration steps, see Configure Data Loader.
Also ensure you are using the most recent version of Data Loader, as newer versions include performance improvements.
If lowering the batch size does not resolve the error and you are using Data Loader versions 21–44, you can manually increase the JVM heap size by modifying the Data Loader startup command.
Note: This workaround is generally not needed for Data Loader version 45 and above (Zulu Java).
If you have a Data Loader shortcut on the Desktop:
-Xms1024m -Xmx1256m to the command. The modified target should look like:"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"
Replace <user> with the Windows username of the machine user.
For Data Loader version 37 on Windows 7:
"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"
If you do not have a shortcut on the Desktop:
You may need to try different heap size values depending on your system's total available memory. On 32-bit operating systems, the heap size cannot exceed 2 GB.
000385819

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.