Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] java.lang.OutOfMemoryError: Java heap space

Hi All.
One Table have 4million rows.
I am Exporting 4million rows to csv file i am getting below error.
"Exception in thread "main" java.lang.OutOfMemoryError: Java heap space"
How to increase Java heap space?
Thanks
kumar.talend

Labels (2)
40 Replies
Anonymous
Not applicable
Author

You re running Talend on a 32 bits OS so you cant exceed 1536Mo for the JVM memory.
Please use the cursor option, but not with 5M value. Lower it to 100 000 rows. Should work.
_AnonymousUser
Specialist III
Specialist III

Hi guys,
I am having exactly the same error with the user above in Talend. Did someone find a solution to this as yet?
Your help is much appreciated as I am in the middle of a project.
Thanks and Regards,
AG
Anonymous
Not applicable
Author

Hi,
I had the same error and these posts were helpful.
In the Postgres input, 'Advanced Settings' I set "use cursor" to 100 000.
In the Run 'Advanced Settings' I put both JVM arguments to Xms1024M and Xmx1024M.
It worked.
Anonymous
Not applicable
Author

Hi telena
Glad to see you figure it out and thanks for your feedback!
Best regards
Shong
_AnonymousUser
Specialist III
Specialist III

Hi,
Hope these articles on talend help center will be useful for your job.
Exception+Could+not+reserve+enough+space+for+object+heap
Exception+outOfMemory.
Best regards
Sabrina
Hey I want to generate data using java progam but i'm getting an error Exception in thread "main" java.lang.OutOfMemoryError: Java heap space. Can you plz help me
Anonymous
Not applicable
Author

Hi  mukuljain015,
Hey I want to generate data using java progam but i'm getting an error Exception in thread "main" java.lang.OutOfMemoryError: Java heap space. Can you plz help me


Have you already changed your  JVM arguments in   'Advanced Settings' of  Run tab? Did this issue only repro on your specific job? Could you please give us more information about your current situation?

Best regards
Sabrina
Anonymous
Not applicable
Author

Hi, i have the same problem but it happens when procesing a Delimited File with 381996 records. I tried setting the VM arguments of the job to -Xms1024M and Xmx1024M but still throws the Java Heap Space Exception. 

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2367)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415)
at java.lang.StringBuilder.append(StringBuilder.java:132)
Anonymous
Not applicable
Author

Hi sbravo,
What's your whole job design? Is there any DB component?Did you use any tMap, tUniqRow, tSortRow component in your work flow? What's the RAM of your machine?
Best regards
Sabrina
cmadaka
Contributor
Contributor

other option you can try is selecting 'stream the file' in component view of the input file. (only for file based inputs)
Regards
Anonymous
Not applicable
Author

Hi,
I am using two source files (delimited .dat files ). Both the files have 2 million records . I am joining these files in tmap and sending the output to a flat file (.dat). but its giving me Java heap memory error after reading 1 lakh records.
I have tried all the options written in above comments ( tried increasing Xmx parameter, Store temp data =Yes), but still I am getting the error.
Can someone please suggest what should I Try.