44

I have a .sql file with size 1047399KB,I'm trying to run it on Windows10 with 4.00GB RAM on DBeaver program, i got java.lang.OutOfMemoryError: Java heap space error

I tried many solutions but didn't work with me. file.sql -Xms128m -Xmx512m, file.sql -vmargs -Xmx1024M, file.sql -Xmx800m -Xms500m all didn't work with me.

6
  • All depends on the underlining java application implementation. If it trys to load the whole file before process it, you have to allocate at least 2GB of memory Commented Sep 20, 2018 at 12:49
  • 1
    You may also have luck modifying the dbeaver.ini file to increase the heap size. Commented Feb 13, 2020 at 5:34
  • 1
    @ZeyadEtman : As per dbeaver.io/forum/viewtopic.php?f=2&t=1162. We can set max memory to 1GB. I tried with 2048 and 4096 but same issue faced. But when I tried with "-vmargs -Xmx1024m" it works well. Commented Nov 29, 2021 at 11:15
  • @Raedwald It's a question about DBeaver, not Java. This is not a duplicate. Commented Aug 30, 2022 at 18:13
  • @vintproxvintpro the accepted answer indicates it is a duplicate Commented Aug 31, 2022 at 6:59

1 Answer 1

61

I encountered same issue: every time you get it, you have to allocate more space and run DBeaver itself first with additional flags -vmargs -Xmx*m. Replace * with 2048 or 4096.

It doesn't look like DBeaver takes garbage out when closing the script, so I had to restart application many times to check right amount of memory needed.

@Timothy Jannace just pointed out that you also can edit dbeaver.ini. Example.

Sign up to request clarification or add additional context in comments.

12 Comments

Thanks this solved my problem! It's a bit worrying that a test of SELECT * FROM LEFT JOIN for a small database actually takes around 2GB ram.
@NicholasHumphrey Well, I noticed phpMyAdmin comes in handy for import task, for example, better than DBeaver and HeidiSQL. I was assuming that native software must provide more seamless experience and overtake memory limits of web application, but it's not the case with specific, database software, I guess.
can someone explain how to run DBeaver from command line? I am using Mac OS version. It seems it is an .app file
@cryanbhu edit dbeaver.ini file as shown here. Path should be something like /Applications/DBeaverEE.app/Contents/Eclipse/dbeaver.ini.
3 years later and this still works like a charm to prevent OOM exceptions. The provided example link lists the typical paths, for non-standard in stalls the comment section on the gist is extremely helpful
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.