Skip navigation.

exploreopera

| Help

Sign up | Help

Posts tagged with "eclipse"

how to solve OutOfMemoryErrors during coding with eclipse.

Allocating enough memory and solving OutOfMemoryErrors
By default, Eclipse will allocate up to 256 megabytes of Java heap memory. This should be ample for all typical development tasks. However, depending on the JRE that you are running, the number of additional plug-ins you are using, and the number of files you will be working with, you could conceivably have to increase this amount. Eclipse allows you to pass arguments directly to the Java VM using the -vmargs command line argument, which must follow all other Eclipse specific arguments. Thus, to increase the available heap memory, you would typically use:

eclipse -vmargs -Xmx<memory size>
for example: eclipse -vmargs -Xmx512m

with the <memory size> value set to greater than "256M" (256 megabytes -- the default).

When using a Sun VM, you may also need to increase the size of the permanent generation memory. The default maximum is 64 megabytes, but more may be needed depending on your plug-in configuration and use. The maximum permanent generation size is increased using the -XX:MaxPermSize=<memory size> argument:

eclipse -vmargs -XX:MaxPermSize=<memory size>
for example: eclipse -vmargs -XX:MaxPermSize=40m

This argument may not be available for all VM versions and platforms; consult your VM documentation for more details.

Note that setting memory sizes to be larger than the amount of available physical memory on your machine will cause Java to "thrash" as it copies objects back and forth to virtual memory, which will severely degrade your performance.

eclipse 3.2 +lomboz 3.2的安装

一、下载最新的工具包
首先到以下的几个网址去下载相关工具包:
1. eclipse 3.2 http://www.eclipse.org/downloads
因为我用的是windows xp2 的操作系统,所以下载的包名是:eclipse-SDK-3.2-win32.zip(只要类似的都可以)。
2. lomboz 3.0 http://lomboz.objectweb.org/downloads/drops
找到一个名称类似于lomboz-and-prereqs-R-3.2-200610201336.zip(md5)的包就可以了,避免再去下载并安装相 应的emf-sdo-runtime,在lomboz-and-prereqs-R-3.2-200610201336.zip(md5)中已经有了 emf-sdo-runtime。也给我们减掉了许多不必要的麻烦。(这个文件目录层次太深了,windows下解压要把它解压到根目录下,否则解压过程会出问题)
LOMBOZ 的版本要和你的 Eclipse 版本相对应。 一 般来说相同版本号的才比较兼容。 ? 即: 3.2 的 Eclipse 对应插件就装 3.2 的 Lomboz ; Eclipse3.2 其对应插件为 lomboz.3.2 ,这样不容易出错,下载时最好认真阅读网站上的说明,否则有时安装总会出现莫名其妙的问题,浪费时间。
安装Lomboz需要Gef和Emf等插件的支持,所以仅仅下载安装?Eclipse3.2,和lomboz 3.2还不够,必须下载以下两个插件:
lomboz-and-prereqs-S-3.2RC2-200608081203.zip 和 lomboz-S-3.2RC2-200608081203.zip ( 或 lomboz-all-in-one-S-3.2RC2-200608081203-win32.zip ) lomboz-and-prereqs-S-3.2RC2-200608081203.zip 和 lomboz-S-3.2RC2-200608081203.zip 这两个文件 95M 左右,我一开始是用的集成的 all-in-one 版的 lomboz ,这个 all-in-one 版的 lomboz 大概 210M 左右,用它的时候启动 Eclipse 的时候比较慢,现在改用非 all-in-one 版 Lomboz 插件了。
这一点(安装Lomboz 需要Gef和Emf等插件的支持)很容易被忽视,结果安装时有时就会碰到一个问题:?按照步骤安装好后,启动Eclipse,在【window】--- >【Preference】左侧菜单上跟本找不到lomboz安装成功标志如多出了web services、web and XML等节点。?而在【Help】-->【About Eclipse Platform】--->【Plug-in Details】 里面查看,却又明明显示Lomboz插件已经安装好了。这个问题了我半天,网上一些中文安装方法都没有明确说清楚,其实要安装好lomboz,gef和 emf等插件 (在 lomboz-and-prereqs-S-3.2RC2-200608081203.zip 文件中已经包含了这些插件) 也是需要装的。


3. eclipse 3.2 汉化包 http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/L-3.2_Language_Packs-200607121700/NLpack1-eclipse-platform-SDK-3.2-win32.zip
二、安装eclipse 3.2
众所周知,eclipse直接进行解压就可以使用,假设直接解压到D盘:D:\eclipse。
三、安装lomboz 3.2
以前常用的安装办法就是把eclipse的所有插件包,包括lomboz解压后都直接往D:\eclipse\plugins\中放就行了,但是这样做了 以后,plugins文件夹中的文件相对混乱,不利于以后的一些工作。比较科学的做法是设置一个配置文件指向新的插件包文件夹就可以了,下面先看看具体的 做法。
在eclipse的根目录下,也就是在D:\eclipse\中新建一个文件夹links,里面放置这次或者是以后需要的所有配置文件,在D:\ eclipse\links\中新建一个配置文件:lomboz.link,内容是path = other_plugins/lomboz,那么每次eclipse启动的时候就会根据这些配置文件中path指向的位置去查找新的插件。然后再在D:\ eclipse\中新建一个文件夹lomboz,里面放置的是lomboz压缩包中的内容,注意lomboz压缩包中的根目录文件夹是eclipse,所 以解压到D:\eclipse\lomboz后的文件目录也应该是D:\eclipse\lomboz\eclipse\.......。
四、安装eclipse 3.2的汉化包
与上面安装lomboz 3.2插件的方法一样,也就不需要我多说了吧。
五、成功
打开eclipse 3.2,选择你需要的workspace位置,在界面中点击:文件→新建→其他,发现里面有web、web servce等项目时,恭喜你,成功!
另外,安装完 lomboz 插件以后,打开 eclipse ,在【 Window 】 -> 【 p references 】 左侧菜单上 看不到 lomboz 节点,在 Eclipse 的早期版本( 3.0 及以前版本)中可以看到 lomboz 选项,但是从 3.1.2 版本及以后就看不到 lomboz 这个选项了(注:我是从 3.0 开始用的,先是用的 3.0, 然后是 3.1.2, 现在我用得是 3.2, 我没用过 3.1.1 这个版本就不知道在 3.1.1 版本中是否显示 lomboz 选项了)。