At 12:35 AM on Jan 16, 2006, Riyad Kalla Javalobby Editors wrote:
Many Eclipse users have adjusted their VM heap size when launching Eclipse by way of the -vmargs -Xmx256m argument. Some have done it to avoid OutOfMemoryException s, to tweak performance or just as good preventative measure for larger installs. However, most users have never worried before about the size of their VM's permSpace or even had a reason to care, this article will hopefully shed some light on situations when you should care and how to weak your heap and perm settings to get some performance gains in Eclipse.
Combating OutOfMemoryExceptions
A majority of OutOfMemoryException s when using Eclipse are caused by too little heap space for your VM. In this case the old wisdom of adjusting your maximum heap space with something like -vmargs -Xmx256m is still good advice; giving your Java apps more space to run in always helps performance. However, there are situations where even with an enourmous heap size you can still end up with OutOfMemoryException s in your workbench. The reason for this is that your VM is not running out of heap space, but is instead running out of what is known as permSpace . The VM's permSpace is the area of the VM that is used to store data structures and class information (not instances, but the class definitions themselves). In the case of a large enough Java application that may contain 10s of thousands of class files that must be loaded you start to see how the VM can physically run out of space storing all of that information into the default permSpace . If you have run into a situation where you have run out of permSpace you will want to adjust your Eclipse shortcut, eclipse.ini , or startup script to include the argument -XX:MaxPermSize=64m ; generally speaking the more memory you give the VM, the more performant it will be. Tuning this value can help you find what works best for your Eclipse install.
Improving Performance
Now let's assume that you are not encountering any exceptions and Eclipse is running just fine, but you would like to improve the performance. I have found 2 rules of thumb when tweaking the heap size and permSize for Eclipse to maximize performance, and that is to 1) give the VM as much ram as you can spare and 2) set your min and max values to the same amounts to avoid resizing. While neither of these guidelines are revolutionary I have found using them both to really help improve performance; in the case of MyEclipse 4.0.3 on Eclipse 3.1 my subjective perception of the performance increase is anywhere from 50% to a 100% increase on my machine (your mileage may varry depending on hardware, current arguments, etc).
For a machine with 512MB of ram with the developer mainly using just Eclipse (any maybe a browser and IM) I would suggest the following arguments: -vmargs -Xms256m -Xmx256m -XX:PermSize=64m -XX:MaxPermSize=64m
For a machine with 1024MB of ram with the similar run case as described above I would suggest: -vmargs -Xms512m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=128m
and for machines with anymore ram than what I outlined above, adjust to fit your preferences. I have 4GB of ram in my machine and use a heap size of 1024m and a permSize of 512m. You may need to go through a few test runs with different settings to find which one works best for your computer. You may find that only using 256m heap space is sufficient while you end up needing to increase your permSize to 128m. I'll leave it up to you to decide.
Conclusion
I hope some of you have found this tip handy. I know adjusting memory arguments is a topic that has been discussed to death since the dawn of Java, but I also know the vast majority of Eclipse users I help have no idea how to adjust the command line arguments that Eclipse uses nor do they understand why they would adjust them. This tip is also intended for folks that were never aware of the permSize arguments and what they can do for runtime performance as well as avoiding mysterious OutOfMemoryException s that make no sense.
I would encourage you all to share your own performance tweaks in your responses as I may have missed some really good arguments here that have helped you see some noticable improvements in performance or reliability. Thanks for reading.
分享到:
相关推荐
Linux Performance and Tuning Guidelines 4285 PDF Linux® is an open source operating system developed by people from all over the world. The source code is freely available and can be used under the ...
Prentice - HP-UX 11i Tuning and Performance.chm
iOS and Macos Performance Tuning: Cocoa, Cocoa Touch, Objective-C, and Swift (Developer's Library) by Marcel Weiher English | 3 Mar. 2017 | ISBN: 0321842847 | 400 Pages | EPUB/PDF (conv) | 42.64 MB ...
Title: Java EE 7 Performance Tuning and Optimization Author: Osama Oransa Length: 398 pages Edition: 1 Language: English Publisher: Packt Publishing Publication Date: 2014-06-25 ISBN-10: 178217642X ...
Linux Debugging and Performance Tuning (Prentice, 2005)
Linux系统性能及调优指南是全面了解Linux操作系统性能特性的重要文档。本文将基于文件内容中提及的知识点,详细阐述Linux操作系统性能相关的各个方面。 首先,文档的第一章主要介绍了Linux操作系统的基础知识,涵盖...
"Linux Debugging and Performance Tuning Tips and Techniques"这个压缩包文件显然是为了帮助用户掌握这些技能而设计的。这里,我们将深入探讨其中可能包含的一些关键知识点。 **Linux Debugging** 1. **日志分析*...
Linux调试技术和性能调优手段,chm格式
《Linux性能优化与调优指南》是IBM发布的一份红皮书,专注于提供关于Linux系统的性能分析和调优策略。这份指南深入浅出地讲解了如何最大化利用Linux系统的硬件资源,提升系统运行效率,适用于系统管理员、开发人员...
Expert Oracle RAC Performance Diagnostics and Tuning provides comprehensive coverage of the features, technology and principles for testing and tuning RAC databases. The book takes a deep look at ...
### Linux调试与性能调优技巧和技术 #### 一、概览 《Linux调试与性能调优:技巧和技术》是一本全面介绍如何在Linux系统中进行软件调试和性能优化的专业书籍。作者Steve Best凭借其在IBM丰富的Linux系统优化经验,...
本文将基于《Oracle Database 12c Release 2 Performance Tuning Tips and Techniques》这本书中提及的关键知识点进行详细介绍。 #### 二、Oracle Database 12c R2的新特性与性能改进 1. **内存管理和优化**:12c ...
Oracle High Performance Tuning for 9i and 10g(CHM Part1~Part2)
The author shares his experience in server-side performance tuning through measured performance assessments, called optimizations. Each optimization discusses techniques to improve the performance ...
IBM红皮书,linux性能优化和调优,多学习!
### Sybase数据库性能优化:锁定机制详解 #### 一、引言 在Sybase数据库管理系统中,锁定(Locking)是实现并发控制的关键技术之一。本文档基于Sybase Adaptive Server Enterprise 12.5.1版本,深入探讨了锁定机制...
《Oracle SQL Performance Tuning and Optimization》是一本专为数据库管理员和开发人员设计的指南,旨在帮助读者深入理解如何优化Oracle数据库中的SQL查询性能。这本书详细介绍了Oracle SQL调优的各个方面,包括...
### Sybase数据库性能与调优系列:查询处理与抽象计划 #### 一、引言 在Sybase数据库管理系统中,查询处理与优化是一项至关重要的任务,它直接影响到系统的整体性能和响应时间。本文档旨在深入探讨Sybase Adaptive...
《Oracle Performance Tuning and Optimization》是一本专注于提升Oracle数据库性能的专业书籍,由Macmillan Computer Publishing出版。在Oracle数据库管理中,性能优化是一项至关重要的任务,它涉及到如何最大化...
Oracle® Fusion Middleware Performance and Tuning for Oracle WebLogic Server 11g Release 1 (10.3.6) E13814-06.pdf