14

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.

Zeyad Etman
  • 1,848
  • 4
  • 20
  • 36
  • 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 – Maxim Sep 20 '18 at 12:49
  • How can i do this? @Maxim – Zeyad Etman Sep 20 '18 at 12:51
  • 1
    You may also have luck modifying the dbeaver.ini file to increase the heap size. – eebbesen Feb 13 '20 at 05:34
  • @ZeyadEtman : As per https://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. – Abhishek Nov 29 '21 at 11:15

1 Answers1

22

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.

vintprox
  • 623
  • 1
  • 7
  • 22
  • 1
    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. – Nicholas Humphrey Apr 30 '19 at 12:40
  • 1
    @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. – vintprox May 01 '19 at 12:57
  • 1
    I tried 1Crore data to important one DB to another DB but the tool is not responding. Then I have increased memory parameters in ".ini" file after that it's successfully imported. Hope it's helpful for someone. – GIRI KUMAR PANEM Mar 04 '20 at 14:30
  • 2
    can someone explain how to run DBeaver from command line? I am using Mac OS version. It seems it is an .app file – cryanbhu May 20 '20 at 05:45
  • Try editing the values in the ini file instead. You should be able to find the file in the program directory of dbeaver. It should be called dbeaver.ini – Timothy Jannace Nov 24 '20 at 19:27
  • 2
    @cryanbhu edit `dbeaver.ini` file as shown [here](https://gist.github.com/souhaiebtar/9bc22ff3eafbba1542b5c05a70228a02). Path should be something like `/Applications/DBeaverEE.app/Contents/Eclipse/dbeaver.ini`. – vintprox Nov 24 '20 at 20:45
  • 1
    I changed two parameters on my dbeaver.ini file: -Xms500m -Xmx4096m worked for me – Joao Vitor Deon May 03 '22 at 15:04