@echo off
if "%OS%" == "Windows_NT" setlocal
rem ---------------------------------------------------------------------------
rem Start/Stop Script for the CATALINA Server
rem
rem Environment Variable Prequisites
rem
rem CATALINA_HOME May point at your Catalina "build" directory.
rem
rem CATALINA_BASE (Optional) Base directory for resolving dynamic portions
rem of a Catalina installation. If not present, resolves to
rem the same directory that CATALINA_HOME points to.
rem
rem CATALINA_OPTS (Optional) Java runtime options used when the "start",
rem or "run" command is executed.
rem
rem CATALINA_TMPDIR (Optional) Directory path location of temporary directory
rem the JVM should use (java.io.tmpdir). Defaults to
rem %CATALINA_BASE%\temp.
rem
rem JAVA_HOME Must point at your Java Development Kit installation.
rem Required to run the with the "debug" argument.
rem
rem JRE_HOME Must point at your Java Runtime installation.
rem Defaults to JAVA_HOME if empty.
rem
rem JAVA_OPTS (Optional) Java runtime options used when the "start",
rem "stop", or "run" command is executed.
rem
rem JSSE_HOME (Optional) May point at your Java Secure Sockets Extension
rem (JSSE) installation, whose JAR files will be added to the
rem system class path used to start Tomcat.
rem
rem JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start"
rem command is executed. The default is "dt_shmem".
rem
rem JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start"
rem command is executed. The default is "jdbconn".
rem
rem JPDA_SUSPEND (Optional) Java runtime options used when the "jpda start"
rem command is executed. Specifies whether JVM should suspend
rem execution immediately after startup. Default is "n".
rem
rem JPDA_OPTS (Optional) Java runtime options used when the "jpda start"
rem command is executed. If used, JPDA_TRANSPORT, JPDA_ADDRESS,
rem and JPDA_SUSPEND are ignored. Thus, all required jpda
rem options MUST be specified. The default is:
rem
rem -Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,
rem address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%
rem
rem $Id: catalina.bat 537517 2007-05-12 21:11:17Z markt $
rem ---------------------------------------------------------------------------
rem Guess CATALINA_HOME if not defined
set CURRENT_DIR=%cd%
if not "%CATALINA_HOME%" == "" goto gotHome
set CATALINA_HOME=%CURRENT_DIR%
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
cd ..
set CATALINA_HOME=%cd%
cd %CURRENT_DIR%
:gotHome
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
echo The CATALINA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
rem Get standard environment variables
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
rem Get standard Java environment variables
if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
echo Cannot find %CATALINA_HOME%\bin\setclasspath.bat
echo This file is needed to run this program
goto end
:okSetclasspath
set BASEDIR=%CATALINA_HOME%
call "%CATALINA_HOME%\bin\setclasspath.bat" %1
if errorlevel 1 goto end
rem Add on extra jar files to CLASSPATH
if "%JSSE_HOME%" == "" goto noJsse
set CLASSPATH=%CLASSPATH%;%JSSE_HOME%\lib\jcert.jar;%JSSE_HOME%\lib\jnet.jar;%JSSE_HOME%\lib\jsse.jar
:noJsse
set CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jar
if not "%CATALINA_BASE%" == "" goto gotBase
set CATALINA_BASE=%CATALINA_HOME%
:gotBase
if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir
set CATALINA_TMPDIR=%CATALINA_BASE%\temp
:gotTmpdir
if not exist "%CATALINA_HOME%\bin\tomcat-juli.jar" goto noJuli
set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties"
:noJuli
rem ----- Execute The Requested Command ---------------------------------------
rem ----- set JAVA_OPTS=-Xms800m -Xmx800m--------
set JAVA_OPTS=-Xms200M -Xmx500M -XX:PermSize=128M -XX:MaxPermSize=256m -verbose:gc -Xloggc:../logs/gclog.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+HeapDumpOnOutOfMemoryError %JAVA_OPTS%
echo Using CATALINA_BASE: %CATALINA_BASE%
echo Using CATALINA_HOME: %CATALINA_HOME%
echo Using CATALINA_TMPDIR: %CATALINA_TMPDIR%
if ""%1"" == ""debug"" goto use_jdk
echo Using JRE_HOME: %JRE_HOME%
goto java_dir_displayed
:use_jdk
echo Using JAVA_HOME: %JAVA_HOME%
:java_dir_displayed
set _EXECJAVA=%_RUNJAVA%
set MAINCLASS=org.apache.catalina.startup.Bootstrap
set ACTION=start
set SECURITY_POLICY_FILE=
set DEBUG_OPTS=
set JPDA=
if not ""%1"" == ""jpda"" goto noJpda
set JPDA=jpda
if not "%JPDA_TRANSPORT%" == "" goto gotJpdaTransport
set JPDA_TRANSPORT=dt_shmem
:gotJpdaTransport
if not "%JPDA_ADDRESS%" == "" goto gotJpdaAddress
set JPDA_ADDRESS=jdbconn
:gotJpdaAddress
if not "%JPDA_SUSPEND%" == "" goto gotJpdaSuspend
set JPDA_SUSPEND=n
:gotJpdaSuspend
if not "%JPDA_OPTS%" == "" goto gotJpdaOpts
set JPDA_OPTS=-Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%
:gotJpdaOpts
shift
:noJpda
if ""%1"" == ""debug"" goto doDebug
if ""%1"" == ""run"" goto doRun
if ""%1"" == ""start"" goto doStart
if ""%1"" == ""stop"" goto doStop
if ""%1"" == ""version"" goto doVersion
echo Usage: catalina ( commands ... )
echo commands:
echo debug Start Catalina in a debugger
echo debug -security Debug Catalina with a security manager
echo jpda start Start Catalina under JPDA debugger
echo run Start Catalina in the current window
echo run -security Start in the current window with security manager
echo start Start Catalina in a separate window
echo start -security Start in a separate window with security manager
echo stop Stop Catalina
echo version What version of tomcat are you running?
goto end
:doDebug
shift
set _EXECJAVA=%_RUNJDB%
set DEBUG_OPTS=-sourcepath "%CATALINA_HOME%\..\..\jakarta-tomcat-catalina\catalina\src\share"
if not ""%1"" == ""-security"" goto execCmd
shift
echo Using Security Manager
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
goto execCmd
:doRun
shift
if not ""%1"" == ""-security"" goto execCmd
shift
echo Using Security Manager
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
goto execCmd
:doStart
shift
if not "%OS%" == "Windows_NT" goto noTitle
set _EXECJAVA=start "Tomcat" %_RUNJAVA%
goto gotTitle
:noTitle
set _EXECJAVA=start %_RUNJAVA%
:gotTitle
if not ""%1"" == ""-security"" goto execCmd
shift
echo Using Security Manager
set SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policy
goto execCmd
:doStop
shift
set ACTION=stop
set CATALINA_OPTS=
goto execCmd
:doVersion
%_EXECJAVA% -classpath "%CATALINA_HOME%\server\lib\catalina.jar" org.apache.catalina.util.ServerInfo
goto end
:execCmd
rem Get remaining unshifted command line arguments and save them in the
set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgs
rem Execute Java with the applicable properties
if not "%JPDA%" == "" goto doJpda
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
goto end
:doSecurity
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
goto end
:doJpda
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %JPDA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
goto end
:doSecurityJpda
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %JPDA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
goto end
:end
分享到:
相关推荐
- **VM设置**:设置JVM参数,如启用JMX远程管理,或者添加特定的JVM代理。 - **过滤器**:可以根据包名或类名设置显示或隐藏的类过滤规则。 五、主要功能实操 1. **CPU分析**:通过采样或剖析,可以找出CPU消耗最多...
"jprofile"则是JProfiler的简称,它是一款强大的Java性能分析工具,用于监控和优化应用程序的内存使用、CPU消耗、线程活动以及其他的JVM性能指标。 首先,让我们深入了解Apache Tomcat 5.5: 1. **Tomcat架构**:...
启动JProfile,首次使用时,可能需要设置JVM参数。在“首选项”或“设置”中,你可以配置JProfiler的默认连接参数。在本机监控时,可以通过“启动Java应用”选项,指定你要分析的应用的主类和相关参数。JProfile会...
2. **配置JVM参数**:在Java应用启动时,添加JProfiler的JVM代理参数,如`-agentpath:/path/to/jprofileragent`。 3. **连接应用**:JProfiler会显示已运行的Java进程列表,选择需要分析的应用连接。 4. **进行...
5. 深度剖析JVM配置:JProfiler 9能检查和调整JVM参数,确保最佳性能。 6. 性能瓶颈定位:通过热点探测,快速找到程序中的性能瓶颈,进行针对性优化。 五、使用JProfiler 9的最佳实践 - 在问题出现时进行分析:...
此外,JProfiler 9.2还具备了对JVM参数的调整和监控功能。用户可以实时查看和修改JVM的配置,如堆大小、垃圾收集器设置等,这在微调系统性能时非常有用。同时,JProfiler还支持远程连接,这意味着开发者可以在本地...
- **VM概览** 面板:显示虚拟机的配置信息,如JVM参数、操作系统信息等。 通过这些面板,你可以监控到如内存泄漏、CPU过载、线程阻塞等问题,并据此进行优化。例如,如果发现内存使用过高,可能是由于对象没有正确...
通过其用户友好的界面,开发者可以轻松地监视和分析运行时的JVM参数,从而优化应用程序的性能。此外,JProfiler还支持远程会话,使得在生产环境中进行性能调试变得更加便捷。 "ant,jprofile二合一视频"可能是一个...
5. **远程监控**:除了本地应用,JProfiler还能监控远程服务器上的Java应用,只需在启动脚本中添加特定的JVM参数。 对于JProfiler 7.2.2或7.2.3版本的安装和配置,以下是一些关键步骤: 1. **下载与安装**:确保...
5. **JVM配置优化**:提供JVM参数建议,帮助优化JVM设置,提升应用性能。 6. **SQL性能分析**:跟踪数据库查询,分析慢查询,展示数据库操作的耗时和频率。 7. **远程连接**:支持远程连接到运行中的Java应用程序...
- **JVM配置优化**:提供对JVM参数的详细视图,帮助调整垃圾回收器、类加载器等配置,提升系统性能。 - **GUI和事件分析**:监测Swing和JavaFX GUI组件的性能,以及AWT和Java事件处理,优化用户界面响应。 - ...
4. 监控JVM参数:实时查看和调整JVM的配置参数。 5. 数据库连接分析:检查数据库查询性能,发现慢查询。 6. 网络I/O和文件I/O监控:评估系统I/O性能。 通过这些功能,JProfiler可以帮助开发者深入理解应用程序的...
自动检测将在当前配置的JVM中生成数据的跟踪类型 异步跟踪状态显示在具有相关操作的调用树视图上方 检测非配置类中的调用是否会创建异步调用并提供记录它 Kotlin协同程序的异步跟踪;基于IntelliJ IDEA的全新明暗...
4. **JVM配置与监控**:JProfiler允许调整JVM参数,如堆大小、垃圾收集器类型等,并实时监测JVM的状态,包括类加载、内存池使用情况和垃圾收集统计。 5. **数据流分析**:对于数据库应用,JProfiler可以追踪SQL查询...
综上所述,Java性能测试与调优是一个涉及多个方面的复杂过程,需要考虑JVM配置、应用服务器设置、数据库性能监控以及代码层面的优化。通过细致地分析和调整,可以显著提高Java应用程序的性能和响应速度。文档中的...
确保这些脚本被正确配置,以包含JProfiler的代理参数,这样WebLogic启动时会启动JProfiler的代理。 8、**启动监控**:点击“Start”按钮,JProfiler将连接到WebLogic服务器,并开始监控指定的Java进程。你可以看到...
这通常需要设置JVM参数,例如添加`-agentpath`选项,指向JProfiler的动态链接库(如`libjprofilerti.dll`),并指定监听端口。 在监控Tomcat性能时,有以下几点是关注的重点: 1. **内存分析**:JProfiler可以显示...
5. **配置JVM参数**: 在运行你的Java应用之前,需要配置JVM参数来连接JProfiler。在Java应用启动命令行中添加以下参数: - `java -agentpath:your_jprofiler_path/bin/win32/jprofiler.exe=port=8849,nowait -jar ...
5. **JVM配置和调优**:提供JVM参数调整建议,帮助用户优化虚拟机配置,提高应用性能。 6. **集成IDE支持**:JProfiler11可以无缝集成到IntelliJ IDEA等开发环境中,方便开发者在编写代码的同时进行性能测试。 7. ...
可以通过JVM参数(如`-agentlib`或`-agentpath`)来启动JProfiler的代理,确保应用服务器与JProfiler能进行通信。 2. **创建会话**:在JProfiler中新建一个会话,选择连接到的应用服务器,并配置必要的连接参数。 ...