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 can increase the heap from the Run->Advanced settings tab. You can also pass parameters etc, if not running in the dev environment. This is not always the best option.
What's your source? If it's MySQL, you can stream the data, for example.
Anonymous
Not applicable
Author

HI tal00000
Thanks for your feedback.
My Source is postgressql.
I increased JVM size : -Xmx2048M
Again I am getting below error:
"Could not create the Java virtual machine.
Error occurred during initialization of VM
Could not reserve enough space for object heap"
Thanks
Kumar.talend
Anonymous
Not applicable
Author

I think that's your own local issue. You can Google to find why you're getting this message.
tPostgressInput->Advanced settings supports "Use cursor" and a solution may lie there.
Anonymous
Not applicable
Author

HI tal00000
Thanks for your feedback.
tPostgressInput->Advanced settings supports "Use cursor".
check the Use cursor check box and enter 5000000 in Box.
But same problem.
"Exception in thread "main" java.lang.OutOfMemoryError: Java heap space"
Any ideas.......
Thanks
kumar.talend
Anonymous
Not applicable
Author

try 1000 and see where that gets you
HI tal00000
Thanks for your feedback.
tPostgressInput->Advanced settings supports "Use cursor".
check the Use cursor check box and enter 5000000 in Box.
But same problem.
"Exception in thread "main" java.lang.OutOfMemoryError: Java heap space"
Any ideas.......
Thanks
kumar.talend
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

Hi Sabrina,
Thanks for your feedback.

I am modify the "TOS_DI-win32-x86.ini" configuration file based on your suggested article.
No changes, i am getting same error.
"Exception in thread "main" java.lang.OutOfMemoryError: Java heap space"

Thanks.
kumar.talend
Anonymous
Not applicable
Author

Hi
I am modify the "TOS_DI-win32-x86.ini" configuration file based on your suggested article.

The "TOS_DI-win32-x86.ini" configuration file is for Talend Studio application itself, not for the job execution, don't know which article or blob have you read, please refer to the KB article Exception+outOfMemory to learn how to allocate more memory to the job execution.
Shong
Anonymous
Not applicable
Author

Hi Shong,
Thanks for your feedback.

I am modify the "TOS_DI-win32-x86.ini" configuration file through talend help center reference article.
and also I tried to increase heap size as per your suggested article.
I tried to increase heap size like below steps:
1)In tMap I select the option Store on disk and given file path.
2) tPostgressInput->Advanced settings supports "Use cursor".
check the "Use cursor" check box and i given 4000000 value.
In Both the case i am getting below error:
"Exception in thread "main" java.lang.OutOfMemoryError: Java heap space".
3)In the Run view, open the Advanced Settings tab and select the Use specific JVM arguments box
and i set the JVM arguments like below:
-Xms512M
-Xmx2048M
In the above case i am getting below error.
"Could not create the Java virtual machine.
Error occurred during initialization of VM
Could not reserve enough space for object heap"

I tried to fix the OutofMemory issue all possible way.But it is escaping.
My job design.
tPostgressInput-->tMap-->tFileOutputDelimeted
Thanks to all for giving your valuable suggestions.
Thanks,
kumar.talend