Increase heap size for sqlworkbench/J

Viewed 18416

How do we increase heap size for SqlWorkbench/J?

I have tried different options but most of it says to execute below command :-

java -Xmx4g -jar sqlworkbench.jar

Even on http://www.sql-workbench.net/manual/install.html#install-increase-memory , it provides me this solution.

Now, I am using macbook. So I have sqlworkbench.app file only. I neither have any .ini file or .jar file for sqlworkbench.

So, how do increase memory size?

4 Answers

After doing a lot of re-search and investigation, I found the solution of this problem in Windows.

To increase heap size for sqlworkbench/J, you have to open your "sqlworkbench.jar" file with the help of PowerShell or CMD.

Steps are mentioned below:

1.) Navigate to the directory containing all files and folder related to this software.I have placed my files in this location. "C:\Users\raushkum\Documents\downloads\Workbench-Build124"

2.) Hold shift and right click anywhere in white space area. A popup will appear with option available "open PowerShell window here". You do either way also- open PowerShell and navigate to the directory containing all files and folder for Sqlworkbench/J software.

3.) After successful navigation to directory just execute following command in PowerShell.

Command: java -Xmx4g -jar sqlworkbench.jar

# Here 4g is the memory i am going to assign to workbench/J. You can change it to 5g,6g,7g etc. as per you requirement.

You can verify your allocated memory size at that time using this way.

1.) Open sqlworkbench/J > click on help > About

You can see in this picture

Drawback: Every time, you have to open like this then only desired memory will be assigned to software. As soon as you close this it'll roll back to default allocation of memory.

Bonus info: You can find all settings,cache,log etc. info in this location:

1.) C:\Users\"user name"\.sqlworkbench

If did not get, try this:

1.) Open sqlworkbench/J > click on help > About

2.) You can see the setting file and log file location.

This isn't the case any longer on MacOS. SQL Workbench has a proper Application Stub. The proper way to change the memory setting is: 1.) in Finder, open the "Applications" folder 2.) Right Click on the "SQL Workbench" icon and select "Show Package Contents" 3.) Open document.wflow with TextEdit (this may be right click, "Open With..." "Other...", select TextEdit. 4.) CMD-F Xmx 5.) Replace the value there with the desired one. (e.g. 4g or 8g)

For Windows users: Create a shortcut to the SQLWorkbench64.exe and add the -Xmx option to the target.

Something like this for a 12GB heap:

C:\YourPathTo\WorkbenchJ\SQLWorkbench64.exe -Xmx12g

Launch the app with the shortcut and go to Help->About. You should see free memory toward the bottom of the dialog.

Related