我们的一位测试人员在启动我们的应用程序时,一直在Windows环境中创建一个小的hprof文件。
是否有一些jvm参数可以在启动时指定(在这种情况下,通过一些环境变量),它会在启动创建一个hprof文件?我知道如果你指定cpu = samples,它会在退出时创建一个。
我有理由相信这是一个系统设置。但我不知道哪一个。我们正在运行Oracle的jre 1.6_024,并且jvm作为tomcat 7启动的一部分运行。
更多信息,这是我的设定输出。
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Administrator>SET
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Administrator\AppData\Roaming
CLASSPATH=.;C:\Windows\java\lib\jtapi.jar;.;;
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=RAJSERVER
ComSpec=C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Administrator
JAVA_HOME=C:\Program Files (x86)\Java\jre
LOCALAPPDATA=C:\Users\Administrator\AppData\Local
LOGONSERVER=\\RAJSERVER
NUMBER_OF_PROCESSORS=4
OS=Windows_NT
Path=C:\Program Files (x86)\company\app\resources;C:\Program Files (x
86)\company\app\resources;C:\Python27\;C:\Python27\Scripts;C:\Windows
\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell \v1.0\;C:\Program Files (x86)\Java\jdk1.6.0_24\bin;%APPDATA%\Python \Scripts;C:\Program Files (x86)\Nmap
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.py;.pyw
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=170a
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\ADMINI~1\AppData\Local\Temp\1
TMP=C:\Users\ADMINI~1\AppData\Local\Temp\1
USERDOMAIN=RAJSERVER
USERNAME=Administrator
USERPROFILE=C:\Users\Administrator
windir=C:\Windows
这是tomcat启动应用程序后我的系统属性的转储。
prps awt.toolkit = sun.awt.windows.WToolkit
prps catalina.home = C:\Program Files (x86)\company\application\Tomcat
prps catalina.useNaming = true
prps com.sun.jndi.ldap.connect.pool.protocol = plain ssl
prps com.sun.jndi.ldap.connect.pool.timeout = 10000
prps file.encoding.pkg = sun.io
prps file.encoding = UTF-8
prps java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
prps java.awt.printerjob = sun.awt.windows.WPrinterJob
prps java.class.path = C:\Program Files (x86)\company\application\Tomcat\bin\bootstrap.jar;C:\Program Files (x86)\company\application\Tomcat\bin\tomcat-juli.jar;C:\Program Files (x86)\company\application\Tomcat\bin\tomcat-juli.jar;C:\Program Files (x86)\company\application\Java\lib\tools.jar;C:\Windows\java\lib\jtapi.jar;C:\Windows\java\lib\jtracing.jar
prps java.class.version = 50.0
prps java.endorsed.dirs = C:\Program Files (x86)\company\application\Tomcat\endorsed
prps java.ext.dirs = C:\Program Files (x86)\company\application\Java\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
prps java.home = C:\Program Files (x86)\company\application\Java\jre
prps java.io.tmpdir = C:\Program Files (x86)\company\application\Tomcat\temp
prps java.library.path = C:\Program Files (x86)\company\application\webapp\resources
prps java.naming.factory.initial = org.apache.naming.java.javaURLContextFactory
prps java.naming.factory.url.pkgs = org.apache.naming
prps java.runtime.name = Java(TM) SE Runtime Environment
prps java.runtime.version = 1.6.0_27-b07
prps java.specification.name = Java Platform API Specification
prps java.specification.vendor = Sun Microsystems Inc.
prps java.specification.version = 1.6
prps java.vendor.url = http://java.sun.com/
prps java.version = 1.6.0_27
prps java.vm.info = mixed mode
prps java.vm.name = Java HotSpot(TM) Server VM
prps java.vm.specification.name = Java Virtual Machine Specification
prps java.vm.specification.vendor = Sun Microsystems Inc.
prps java.vm.specification.version = 1.0
prps java.vm.vendor = Sun Microsystems Inc.
prps java.vm.version = 20.2-b06
prps line.separator =
prps log4j.configuration = file:/C:\Program Files (x86)\company\application\webapp/WEB-INF/logConfiguration.properties
prps os.arch = x86
prps os.name = Windows Server 2008 R2
prps os.version = 6.1
prps package.definition = sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
prps path.separator = ;
prps RUN_UNDER_ECLIPSE = false
prps shared.loader =
prps sun.arch.data.model = 32
prps sun.boot.class.path = C:\Program Files (x86)\company\application\Java\jre\lib\resources.jar;C:\Program Files (x86)\company\application\Java\jre\lib\rt.jar;C:\Program Files (x86)\company\application\Java\jre\lib\sunrsasign.jar;C:\Program Files (x86)\company\application\Java\jre\lib\jsse.jar;C:\Program Files (x86)\company\application\Java\jre\lib\jce.jar;C:\Program Files (x86)\company\application\Java\jre\lib\charsets.jar;C:\Program Files (x86)\company\application\Java\jre\lib\modu
prps sun.boot.library.path = C:\Program Files (x86)\company\application\Java\jre\bin
prps sun.jnu.encoding = Cp1252
prps sun.management.compiler = HotSpot Tiered Compilers
prps sun.net.client.defaultConnectTimeout = 15000
prps sun.net.client.defaultReadTimeout = 20000
prps sun.os.patch.level = Service Pack 1
prps tomcat.util.buf.StringCache.byte.enabled = true
prps tomcat.util.scan.DefaultJarScanner.jarsToSkip = bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,jasper.jar,jasper-el.jar,ecj-*.jar,tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,commons-beanutils*.jar,commons-codec*.jar,commons-collections*.jar,commons-dbcp*.jar,commons-digester*.jar,
prps user.country = US
prps user.dir = C:\Windows\system32
prps user.home = C:\
prps user.language = en
prps user.name = RAJSERVER$
prps user.timezone = America/Chicago
prps user.variant =
syskey CommonProgramFiles = C:\Program Files (x86)\Common Files
syskey CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
syskey CommonProgramW6432 = C:\Program Files\Common Files
syskey COMPUTERNAME = RAJSERVER
syskey ComSpec = C:\Windows\system32\cmd.exe
syskey FP_NO_HOST_CHECK = NO
syskey JAVA_HOME = C:\Program Files (x86)\Java\jre
syskey LOCALAPPDATA = C:\Windows\system32\config\systemprofile\AppData\Local
syskey NUMBER_OF_PROCESSORS = 4
syskey OS = Windows_NT
syskey Path = C:\Program Files (x86)\company\application\resources;C:\Python27\;C:\Python27\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Java\jdk1.6.0_24\bin;
syskey PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.py;.pyw
syskey PROCESSOR_ARCHITECTURE = x86
syskey PROCESSOR_ARCHITEW6432 = AMD64
syskey PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
syskey PROCESSOR_LEVEL = 6
syskey PROCESSOR_REVISION = 170a
syskey ProgramData = C:\ProgramData
syskey ProgramFiles = C:\Program Files (x86)
syskey ProgramFiles(x86) = C:\Program Files (x86)
syskey ProgramW6432 = C:\Program Files
syskey PSModulePath = C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
syskey PUBLIC = C:\Users\Public
syskey SystemDrive = C:
syskey SystemRoot = C:\Windows
syskey TEMP = C:\Windows\TEMP
syskey TMP = C:\Windows\TEMP
syskey USERDOMAIN = WORKGROUP
syskey USERNAME = RAJSERVER$
syskey USERPROFILE = C:\Windows\system32\config\systemprofile
syskey windir = C:\Windows
答案 0 :(得分:1)
查看 * JAVA_TOOL_OPTIONS * 环境变量,它可能包含类似
的内容JAVA_TOOL_OPTIONS="-agentlib:hprof"