---
title: "jvm调优的实际应用"
author: "dmwdmc"
date: "2013-06-11T19:55:46Z"
tags: []
categories: ["企业架构"]
slug: "jvm"
draft: false
lastmod: "2013-07-03T14:11:45Z"
id: 1885475
url: "https://dmwdmc.iteye.com/blog/1885475"
---

具体调优，我们可以参照这里一位的文章
http://unixboy.iteye.com/blog/174173
-Xmx3550m：设置JVM最大可用内存为3550M。
-Xms3550m：设置JVM促使内存为3550m。此值可以设置与-Xmx相同，以避免每次垃圾回收完成后JVM重新分配内存。
实际中我们哪里可以用到呢？
在我们的websphere服务器中。
例如以下profile路径下
C:\IBM\websphere\profiles\BBBCB\config\cells\PCNAMENode02Cell\nodes\PCNAMENode02\servers\server1

有个server.xml配置文件。打开后里面有　initialHeapSize　和maximumHeapSize
，它就是jvm参数对应的-Xms 和-Xmx

>  <jvmEntries xmi:id="JavaVirtualMachine_1369040856397" verboseModeClass="false" verboseModeGarbageCollection="false" [color=indigo]initialHeapSize="512" maximumHeapSize="1024" [/color]verboseModeJNI="false" runHProf="false" hprofArguments="" debugMode="false" debugArgs="-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777" genericJvmArguments=""/>



在maven中的应用。

> C:\RTC\projectname>mvn eclipse:eclipse		
> C:\RTC\projectname>set MAVEN_OPTS=-Xms128m -Xmx1300m	
	


在eclipse中的应用。
文件eclipse.ini


> -startup
> plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
> --launcher.library
> plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
> -product
> org.eclipse.epp.package.jee.product
> --launcher.XXMaxPermSize
> 256M
> -showsplash
> org.eclipse.platform
> --launcher.XXMaxPermSize
> 256m
> -vmargs
> -Dosgi.requiredJavaVersion=1.5
> [color=indigo]-Xms40m
> -Xmx512m[/color]