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.
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.
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.
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).
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With