8

I'm running SQuirreL SQL (2.6.8) on Max OS X.

I'm running out of heap space when trying to create a Table script.

How to configure SQuirreL SQL to start up with a higher JVM heap size?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Erik
  • 997
  • 4
  • 14
  • 24

5 Answers5

6

Assuming you have the SQuirreL in your Dock you can do following:

  1. Cmd-Click on the SQuirreL icon in the Dock, the Finder window will open showing the you the application.
  2. Left-Click on the SQuirreL Application and choose "Show package contents"
  3. Navigate into Contents folder and open Info.plist file
  4. Change or add following to your Info.plist file:
<key>Java</key>   
 <dict>
    <key>VMOptions</key> 
    <array> 
        <string>-Xms128m</string> 
        <string>-Xmx512m</string> 
    </array> 
</dict>

Here you get 128M at the start time with maximal SQuirreL.

Save the Info.plist file and restart the application.

pkaeding
  • 36,513
  • 30
  • 103
  • 141
  • 8
    Actually, that does not work for me (it does nothing). What did work in the end was to change the .sh file inside the application folder (./Applications./SQuirreLSQL/Contents/MacOS/squirrel-sql.sh) and change "-Xmx256m" to "-Xmx1024m" – Daniel Iversen Dec 02 '11 at 06:02
  • 1
    change -Xmx256m in /Applications/SQuirreLSQL.app/Contents/MacOS/squirrel-sql.sh on OSX10.9 – alex Mar 10 '14 at 18:03
3

I'm running Linux, so you'll have to adapt this answer somewhat, but it should be applicable.

In the home directory that the installer jar creates, you'll find a file called "squirrel-sql.sh". The last line of this file is the java launch cmd. Not sure about the mac launch configuration, you might need to look for the file in this directory that contains this line. Mine reads

$JAVA -Xmx256m -cp $TMP_CP net.sourceforge.squirrel_sql.client.Main --log-config-file $SQUIRREL_SQL_HOME/log4j.properties --squirrel-home $SQUIRREL_SQL_HOME $1 $2 $3 $4 $5 $6 $7 $8 $9

The -Xmx256m configures the heap - it sets the max heap size to 256m. Just edit the file to read -Xmx512m or whatever. (for a list of the memory flags, type "java -X" at a command prompt).

Steve B.
  • 55,454
  • 12
  • 93
  • 132
2

SQuirreL SQL Client Version 3.7 - Windows

I had the following popup:

Error exceeded memory

The query results have exceeded the maximum amount of memory allocated to this application. All result tabs have been closed to allow you to save your work and restart the application.

and the following message in console (Error tab):

OutOfMemoryError

java.lang.OutOfMemoryError: GC overhead limit exceeded
Position: 0

Solution

  1. Right click on the SQuirreL icon > Properties

    SQuirreL icon

  2. Copy the Target value

    SQuirreL target

  3. Open that .bat file in an editor and replace -Xmx256m with -Xmx1024m:

    start "SQuirreL SQL Client" /B "%LOCAL_JAVA%" -Xmx1024m -Dsun.awt.nopixfmt=true -Dsun.java2d.noddraw=true -cp %SQUIRREL_CP% -splash:"%SQUIRREL_SQL_HOME%/icons/splash.jpg" net.sourceforge.squirrel_sql.client.Main %TMP_PARMS%
    
  4. Save and open again SQuirreL SQL.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
0

Thank you this helped me, at first I edited the squirrel-sql.bat file from -Xmx256m to --Xmx1024m but that didn't work, so I changed it to --Xmx4096m and it worked.

alexander.polomodov
  • 5,396
  • 14
  • 39
  • 46
-2

I was facing this situation on the Windows 8 Pro machine and i located this file squirrel-sql.sh on the root folder and edited the following args:

-Xmx256m to --Xmx4096m

it has resolved my issue altogether....!