如何减少Eclipse Ganymede的内存使用? [英] How can I reduce Eclipse Ganymede's memory use?
问题描述
我不会在Eclipse中做任何特别重的工作,例如启动应用服务器或连接到数据库,但由于某种原因,使用几个小时后,我看到Eclipse正在使用接近500MB的内存。
有没有人知道为什么Eclipse会使用这么多的内存(泄漏?),更重要的是,如果有什么可以改进的这个?
我不了解Eclipse,我使用IntelliJ也会受到内存增长(无论你是积极使用或不使用!)。无论如何,在IntelliJ中,我无法消除这个问题,但是通过使用运行时VM选项来减慢内存增长。您可以尝试在Eclipse中重新设置这些内容,看看它们是否有所作为。
您可以在eclipse文件夹中的eclipse.ini文件中编辑VM选项。 >
我发现(在IntelliJ中)垃圾回收器设置对内存增长有多快的影响。我的设置是:
-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/ 用于各个设置的说明)。正如你所看到的,我更关心在编辑期间避免长时间停留,而不是使用内存使用,但是您可以将其作为开始。
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.
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.
Does anybody know why Eclipse uses so much memory (leaky?), and more importantly, if there's anything I can do to improve this?
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.
You can edit the VM options in the eclipse.ini file in your eclipse folder.
I found that (in IntelliJ) the garbage collector settings had the most effect on how fast the memory grows.
My settings are:
-Xms128m
-Xmx512m
-XX:MaxPermSize=120m
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
(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屋!