macos 在 Max OS X 上增加 SQuirreL SQL 的堆大小

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/697165/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:05:35  来源:igfitidea点击:

Increasing Heap size for SQuirreL SQL on Max OS X

javamacossquirrel-sql

提问by Erik

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

我在 Max OS X 上运行 SQuirreL SQL (2.6.8)。

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?

如何配置 SQuirreL SQL 以使用更高的 JVM 堆大小启动?

采纳答案by Erik

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

假设您的 Dock 中有 SQuirreL,您可以执行以下操作:

  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:
  1. Cmd-单击 Dock 中的 SQuirreL 图标,Finder 窗口将打开,向您显示该应用程序。
  2. 左键单击 SQuirreL 应用程序并选择“显示包内容”
  3. 导航到 Contents 文件夹并打开 Info.plist 文件
  4. 将以下内容更改或添加到您的 Info.plist 文件中:
<key>Java</key>   
 <dict>
    <key>VMOptions</key> 
    <array> 
        <string>-Xms128m</string> 
        <string>-Xmx512m</string> 
    </array> 
</dict>
<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.

在这里,您在开始时间以最大 SQuirreL 获得 128M。

Save the Info.plist file and restart the application.

保存 Info.plist 文件并重新启动应用程序。

回答by Steve B.

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

我正在运行 Linux,所以你必须稍微调整这个答案,但它应该是适用的。

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

在安装程序 jar 创建的主目录中,您将找到一个名为“squirrel-sql.sh”的文件。该文件的最后一行是 java 启动 cmd。不确定 mac 启动配置,您可能需要在此目录中查找包含此行的文件。我的阅读

$JAVA -Xmx256m -cp $TMP_CP net.sourceforge.squirrel_sql.client.Main --log-config-file $SQUIRREL_SQL_HOME/log4j.properties --squirrel-home $SQUIRREL_SQL_HOME         

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).

-Xmx256m 配置堆 - 它将最大堆大小设置为 256m。只需编辑文件以读取 -Xmx512m 或其他内容。(要获得内存标志的列表,请在命令提示符下键入“java -X”)。

回答by ROMANIA_engineer

SQuirreL SQL Client Version 3.7 - Windows

SQuirreL SQL 客户端 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

java.lang.OutOfMemoryError:超出 GC 开销限制
位置:0

Solution

解决方案

  1. Right click on the SQuirreL icon > Properties

    SQuirreL icon

  2. Copy the Targetvalue

    SQuirreL target

  3. Open that .bat file in an editor and replace -Xmx256mwith -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.

  1. 右键单击 SQuirreL 图标 >属性

    松鼠图标

  2. 复制目标价值

    松鼠目标

  3. 在编辑器中打开该 .bat 文件并替换-Xmx256m-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. 保存并再次打开 SQuirreL SQL。

回答by user8744261

Thank you this helped me, at first I edited the squirrel-sql.batfile from -Xmx256mto --Xmx1024mbut that didn't work, so I changed it to --Xmx4096mand it worked.

谢谢你这对我有帮助,起初我编辑了squirrel-sql.bat文件-Xmx256m--Xmx1024m但是没有用,所以我把它改成了 --Xmx4096m并且它起作用了。

回答by Hawaande

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:

我在 Windows 8 Pro 机器上遇到了这种情况,我在根文件夹中找到了这个文件 squirrel-sql.sh 并编辑了以下参数:

-Xmx256m to --Xmx4096m

-Xmx256m 到 --Xmx4096m

it has resolved my issue altogether....!

它完全解决了我的问题......!