如何生成 hprof文件 + weblogic启动文件配置

当系统宕机且weblogic生成的.phd和javacore文件无法直观定位内存问题时,文章介绍了如何通过修改startWebLogic.sh脚本,配置生成hprof文件以便使用MAT工具进行更有效的内存泄漏分析。通过添加LOG_OPTIONS参数,可以设置heapdump路径和错误日志路径,便于在故障时自动生成hprof文件。
摘要由CSDN通过智能技术生成

系统宕机了,weblogic生成 .phd 和  javacore文件,分别使用 jca457.jar  和  ha456.jar来分析,但是heapdump文件分析时指向的问题和内存泄漏点类并不是很方便对应我们的代码,所以想使用mat工具来分析,但是需要生成 hprof文件


需要修改startWebLogic.sh文件,宕机时就会自动生成对应的hprof文件


LOG_OPTIONS="-Xloggc:$LOG_PATH/gc.$$.log -XX:+PrintGCDetails  -XX:+PrintGCTimeStamps -XX:HeapDumpPath=$LOG_PATH/heapdump.$$.hprof -XX:ErrorFile=$LOG_PATH/hs_err_pid.$$.log" 







#!/bin/sh


# WARNING: This file is created by the Configuration Wizard.
# Any changes to this script may be lost when adding extensions to this configuration.


# --- Start Functions ---


stopAll()
{
# We separate the stop commands into a function so we are able to use the trap command in Unix (calling a function) to stop these services
if [ "X${ALREADY_STOPPED}" != "X" ] ; then
exit
fi
# STOP DERBY (only if we started it)
if [ "${DERBY_FLAG}" = "true" ] ; then
echo "Stopping Derby server..."
${WL_HOME}/common/derby/bin/stopNetworkServer.sh  >"${DOMAIN_HOME}/derbyShutdown.log" 2>&1 


echo "Derby server stopped."
fi


ALREADY_STOPPED="true"
}


classCaching()
{
echo "Class caching enabled..."
JAVA_OPTIONS="${JAVA_OPTIONS} -Dlaunch.main.class=${SERVER_CLASS} -Dlaunch.class.path="${CLASSPATH}" -Dlaunch.complete=webl
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值