简体   繁体   中英

Increase heap size for sqlworkbench/J in Ubuntu

I tried running an SQL query on my SQLworkbench on my Ubuntu OS

SELECT *,d.dept_name,
 MAX(salary)
OVER(
  PARTITION BY d.dept_name
  ) AS "SAL"
FROM salaries
JOIN dept_emp AS de USING(emp_no)
JOIN departments AS d USING(dept_no)

It was running when I suddenly got a pop up message sql workbench the system is running low on memory. to prevent data corruption the current operation has been aborted. please increase the heap size with the -xmx parameter.

I went through some similar post on Stackoverflow and I found this one Increase heap size for sqlworkbench/J

It mentioned running a command java -Xmx4g -jar sqlworkbench.jar which I did but when I do that it runs a completely new instance of my Workbench as if I am freshly installing it. Please help I will be doing a lot of PARTITION BY queries but I am hindered by this issue.. I checked the free memory and it is 1924MB/1966MB .

Also when the above pop-up message shows, besides my memory usage spiking up whilst running the query before finally giving that pop-up message... the query timer still keeps counting and my memory usage is as it is as if the query is running, and the option to cancel execution is not available, unless I finally close the SQLworkbench then my system memory usage comes back to normal.

Please help I have an 64bit system with 8GB RAM

SQLworkbench folder files

MEMORY SIZE INFORMATION FOR SQLWORKBENCH

The relevant part of sqlworkbench.sh are these lines:

exec "$JAVACMD"  $OPTS \
                -Dawt.useSystemAAFontSettings=on \
                -Xverify:none \
                -Dvisualvm.display.name=SQLWorkbenchJ -cp "$cp" workbench.WbStarter "$@"

Just add the -Xmx paramter where you want, eg:

exec "$JAVACMD"  $OPTS \
                -Dawt.useSystemAAFontSettings=on \
                -Xverify:none \
                -Xmx4g \
                -Dvisualvm.display.name=SQLWorkbenchJ -cp "$cp" workbench.WbStarter "$@"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM