




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
性能优化 1 、关闭MyEclipse的自动validation windows perferences myeclipse validation 将Build下全部勾取消 如果你需要验证某个文件的时候,我们可以单独去验证它。方法是: 在需要验证的文件上( 右键 - MyEclipse - Run Validation 。 2、 启动优化,关闭不需要使用的模块 所以可以将一些不使用的模块禁止 加载启动。 Window Preferences General Startup andy Shutdown 在这里列出的是MyEclipse启动时加载的模块 我这里只让它加载tomcat6 勾选 MyEclipse EASIE Tomcat 6 。 WTP :一个跟myeclipse差不多的东西,主要差别是 WTP 是免费的,如果使用myeclipse,这个可以取消 Mylyn:组队任务管理工具,类似于 CVS ,以任务为单位管理项目进度,没用到的可以取消 Derby:一种保存成 jar 形式的数据库,我没用到,取消 一大排以 MyEclipse EASIE 打头的启动项:myeclipse 支持的服务器,只选自己用的,其他取消, 比如我只选了 tomcat 。 3 、去掉MyEclipse的拼写检查(如果你觉的有用可以不去) 拼写检查会给我们带来不少的麻烦,我们的方法命名都会是单词的缩写,他也会提示有错, 所以最好去掉,没有多大的用处 Window perferences General Editors Text Editors Spelling 将Enable spell checking复选框的勾选去掉。 4 、修改MyEclipse编辑JSP页面时的编辑工具 Window perferences General Editors File Associations 在File types 中选择 *.jsp 在Associated editors 中将MyEclipse JSP Editor设置为默认。 还有XML文件的默认编辑器 5 、修改MyEclipse安装目录的myeclipse.ini文件,加大JVM的非堆内存 具体内容如下: -configuration configuration -vmargs -Xms256m -Xmx512m -XX:PermSize=128M -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=64m 6、使用JRockit作为Eclipse的Java VM Eclipse启动参数,指定eclipse启动时使用的jre E:MyEclipse8.0MyEclipse Blue Edition 8.0 GAmyeclipse-blue.exe -vm E:JRockitjrrt-3.1.2-1.6.0binjavaw.exe -vmargs -Xms256m -Xmx512m 在Eclipse里面,Window Preferences,然后选择Java Installed JREs添加JRockit,并设置为默认。 这样,就可以用JRockit来编译项目了。 7. 关闭自动更新 1.window-Perferences-General-Startup and Shutdown 勾掉 Automatic Updates Scheduler(自动更新调度程序) 2.window-Perferences-MyEclipse-Maven4MyEclipse 勾上 Enable Maven4MyEclipse featrures ;确定关闭窗口;该步骤是为了显示第3步中的Maven节点 3.window-Perferences-MyEclipse-Maven4MyEclipse Maven 勾掉 Download repository index updates on startupJVMTwo JVM options are often used to tune JVM heap size: -Xmx for maximum heap size, and -Xms for initial heap size. Here are some common mistakes I have seen when using them: Missing m, M, g or G at the end (they are case insensitive). For example,java -Xmx128 BigAppjava.lang.OutOfMemoryError: Java heap spaceThe correct command should be: java -Xmx128m BigApp. To be precise, -Xmx128 is a valid setting for very small apps, like HelloWorld. But in real life, I guess you really mean -Xmx128m Extra space in JVM options, or incorrectly use =. For example,java -Xmx 128m BigAppInvalid maximum heap size: -XmxCould not create the Java virtual machine.java -Xmx=512m HelloWorldInvalid maximum heap size: -Xmx=512mCould not create the Java virtual machine.The correct command should be java -Xmx128m BigApp, with no whitespace nor =. -X options are different than -Dkey=value system properties, where = is used. Only setting -Xms JVM option and its value is greater than the default maximum heap size, which is 64m. The default minimum heap size seems to be 0. For example,java -Xms128m BigAppError occurred during initialization of VMIncompatible initial and maximum heap sizes specifiedThe correct command should be java -Xms128m -Xmx128m BigApp. Its a good idea to set the minimum and maximum heap size to the same value. In any case, dont let the minimum heap size exceed the maximum heap size. Heap size is larger than your computers physical memory. For example,java -Xmx2g BigAppError occurred during initialization of VMCould not reserve enough space for object heapCould not create the Java virtual machine.The fix is to make it lower than the physical memory: java -Xmx1g BigApp Incorrectly use mb as the unit, where m or M should be used instead.java -Xms256mb -Xmx256mb BigAppInvalid initial heap size: -Xms256mbCould not create the Java virtual machine. The heap size is larger than JVM thinks you would ever need. For example,java -Xmx256g BigAppInvalid maximum heap size: -Xmx256gThe specified size exceeds the maximum representable size.Could not create the Java virtual machine.The fix is to lower it to a reasonable value: java -Xmx256m BigApp The value is not expressed in whole number. For example,java -Xmx0.9g BigAppInvalid maximum heap size: -Xmx0.9gCould not create the Java virtual machine.The correct command should be java -Xmx928m BigAppPS:How to set java heap size in Tomcat?Stop Tomcat server, set environment variable CATALINA_OPTS, and then restart Tomcat. Look at the file tomcat-install/bin/catalina.sh or catalina.bat for how this variable is used. For example,set CATALINA_OPTS=-Xms512m -Xmx512m (Windows)export CATALINA_OPTS=-Xms512m -Xmx512m (ksh/bash)setenv CATALINA_OPTS -Xms512m -Xmx512m (tcsh/csh)In catalina.bat or catallina.sh, you may have noticed CATALINA_OPTS, JAVA_OPTS, or both can be used to specify Tomcat JVM options. What is the difference between CATALINA_OPTS and JAVA_OPTS? The name CATALINA_OPTS is specific for Tomcat servlet container, whereas JAVA_OPTS may be used by other java applications (e.g., JBoss). Since environment variables are shared by all applications, we dont want Tomcat to inadvertently pick up the JVM options intended for other apps. I prefer to use CATALINA_OPTS.How to set java heap size in JBoss?Stop JBoss server, edit $JBOSS_HOME/bin/run.conf, and then restart JBoss server. You can change the line with JAVA_OPTS to something like:JAVA_OPTS=-server -Xms128m -Xmx128mHow to set java heap size in Eclipse?You have 2 options:1. Edit eclipse-home/eclipse.ini to be something like the following and restart Eclipse.-vmargs-Xms64m-Xmx256m2. Or, you can just run eclipse command with additional options at the very end. Anything after -vmargs will be treated as JVM options and passed directly to the JVM. JVM options specified in the command line this way will always override those in eclipse.ini. For example,eclipse -vmargs -Xms64m -Xmx256mHow to set java heap size in NetBeans?Exit NetBeans, edit the file netbeans-install/etc/netbeans.conf. For example,netbeans_default_options=-J-Xms512m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=128m -J-Xverify:noneHow to set java heap size in Apache Ant?Set environment variable ANT_OPTS. Look at the file $ANT_HOME/bin/ant or %ANT_HOME%binant.bat, for how this variable is used by Ant runtime.set ANT_OPTS=-Xms512m -Xmx512m (Windows)export ANT_OPTS=-Xms512m -Xmx512m (ksh/bash)setenv ANT_OPTS -Xms512m -Xmx512m (tcsh/csh)How to set java heap size in jEdit?jEdit is a java application, and basically you need to set minimum/maximum heap size JVM options when you run java command. jEdit by default runs with a default maximum heap size 64m. When you work on large files, you are likely to get these errors:java.lang.OutOfMemoryError: Java heap spaceat java.lang.String.concat(String.java:2001)at org.gjt.sp.jedit.buffer.UndoManager.contentInserted(UndoManager.java:160)at org.gjt.sp.jedit.Buffer.insert(Buffer.java:1139)at org.gjt.sp.jedit.textarea.JEditTextArea.setSelectedText(JEditTextArea.java:2052)at org.gjt.sp.jedit.textarea.JEditTextArea.setSelectedText(JEditTextArea.java:2028)at org.gjt.sp.jedit.Registers.paste(Registers.java:263)How to fix it? If you click a desktop icon, or Start menu item to start jEdit: right-click the icon or menu item, view its property, and you can see its target is something like:C:jdk6binjavaw.exe -jar C:jeditjedit.jarYou can change that line to:C:jdk6binjavaw.exe -Xmx128m -Xms128m -jar C:jeditjedit.jarIf you run a script to start jEdit: just add these JVM options to the java line inside the script file:java -Xmx128m -Xms128m -jar jedit.jarIf you start jEdit by running java command: just add these JVM options to your java command:java -Xmx128m -Xms128m -jar jedit.jarNote that when you run java with -jar option, anything after -jar jar-file will be treated as application arguments. So you should always put JVM options before -jar. Otherwise, you will get error:C:jeditjava -jar jedit.jar -Xmx128mUnknown option: -Xmx128mUsage: jedit How to set java heap size in JavaEE SDK/J2EE SDK/Glassfish/Sun Java System Application S
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 油料作物基方便食品创新创业项目商业计划书
- 智慧环保数字孪生污染监测平台创新创业项目商业计划书
- 植物园艺疗法培训课程创新创业项目商业计划书
- 家具组装创新创业项目商业计划书
- 推广绿色种植加工理念创新创业项目商业计划书
- 九年级班主任学期班务工作计划书
- 医院消毒隔离制度及执行流程标准
- 机械设计及理论复试面试题及答案
- 拆油底壳试题及答案
- 2025-2030骨科手术机器人临床推广障碍与医保支付政策研究
- 2025年安全员b证考试安徽省题库及答案解析
- 首台套申报培训课件
- GB/T 14193.1-2025液化气体气瓶充装规定第1部分:工业气瓶
- 保安安检培训课件
- 2025年肝素行业研究报告及未来行业发展趋势预测
- 2025年脚手架租赁合同3篇
- 医院工作纪律培训课件
- 营房装修施工方案(3篇)
- 品牌基础知识培训内容课件
- 杏仁粉营养分析报告
- 《多边形的面积》大单元教学设计
评论
0/150
提交评论