Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.OutOfMemoryError: Java heap space in DBeaver [duplicate]

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.

like image 328
Zeyad Etman Avatar asked Sep 20 '18 12:09

Zeyad Etman


People also ask

How do I increase my DBeaver heap space?

Yes, you can configure maximum amount of memory DBeaver may consume. Start DBeaver with command line parameters "-vmargs -Xmx1024m" to set maximum memory to 1Gb. On 32bit OS maximum size limited to about 1.5Gb, on 64 bit OS there is not such limit.

How do I fix Java Lang OutOfMemoryError?

1) An easy way to solve OutOfMemoryError in java is to increase the maximum heap size by using JVM options "-Xmx512M", this will immediately solve your OutOfMemoryError.

How do I fix a heap space error?

OutOfMemoryError: Java heap space error occurs when it attempts to add more data into the heap space area, but there is not enough room for it. The solution to fix this problem is to increase the heap space(Default value maybe 128 MB).

How do I free up heap space?

The heap is cleared by the garbage collector whenever it feels like it. You can ask it to run (with System. gc() ) but it is not guaranteed to run.


1 Answers

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.

like image 111
vintprox Avatar answered Sep 17 '22 12:09

vintprox