如何减少 Eclipse Ganymede 的内存使用? [英] How can I reduce Eclipse Ganymede's memory use?

查看:27
本文介绍了如何减少 Eclipse Ganymede 的内存使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Eclipse 的最新 Ganymede 版本,特别是面向 Java EE 和 Web 开发人员的发行版.我安装了一些额外的插件(例如 Subclipse、Spring、FindBugs)并删除了所有 Mylyn 插件.

I use the recent Ganymede release of Eclipse, specifically the distro for Java EE and web developers. I have installed a few additional plugins (e.g. Subclipse, Spring, FindBugs) and removed all the Mylyn plugins.

我没有在 Eclipse 中执行任何特别繁重的工作,例如启动应用程序服务器或连接到数据库,但出于某种原因,在使用几个小时后,我发现 Eclipse 使用了接近 500MB 的内存.

I don't do anything particularly heavy-duty within Eclipse such as starting an app server or connecting to databases, yet for some reason, after several hours use I see that Eclipse is using close to 500MB of memory.

有谁知道为什么 Eclipse 使用这么多内存(泄漏?),更重要的是,如果我能做些什么来改进这一点?

Does anybody know why Eclipse uses so much memory (leaky?), and more importantly, if there's anything I can do to improve this?

推荐答案

我对 Eclipse 不太了解,我使用 IntelliJ,它也受到内存增长的影响(无论您是否积极使用它!).无论如何,在 IntelliJ 中,我无法消除这个问题,但我确实通过使用运行时 VM 选项减慢了内存增长.您可以尝试在 Eclipse 中重置这些,看看它们是否有所不同.

I don't know about Eclipse specifically, I use IntelliJ which also suffers from memory growth (whether you're actively using it or not!). Anyway, in IntelliJ, I couldn't eliminate the problem, but I did slow down the memory growth by playing with the runtime VM options. You could try resetting these in Eclipse and see if they make a difference.

您可以在 eclipse 文件夹中的 eclipse.ini 文件中编辑 VM 选项.

You can edit the VM options in the eclipse.ini file in your eclipse folder.

我发现(在 IntelliJ 中)垃圾收集器设置对内存增长的速度影响最大.

I found that (in IntelliJ) the garbage collector settings had the most effect on how fast the memory grows.

我的设置是:

-Xms128m
-Xmx512m
-XX:MaxPermSize=120m
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing

(参见 http://piotrga.wordpress.com/2006/12/12/intellij-and-garbage-collection/ 用于解释各个设置).如您所见,与实际内存使用情况相比,我更关心的是在编辑过程中避免长时间停顿,但您可以以此为起点.

(See http://piotrga.wordpress.com/2006/12/12/intellij-and-garbage-collection/ for an explanation of the individual settings). As you can see, I'm more concerned with avoiding long pauses during editting than actuial memory usage but you could use this as a start.

这篇关于如何减少 Eclipse Ganymede 的内存使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆