首页 > 基础资料 博客日记

【Eclipse Memory Analyzer】java heap dump文件分析示例

2024-08-22 13:00:07基础资料围观126

这篇文章介绍了【Eclipse Memory Analyzer】java heap dump文件分析示例,分享给大家做个参考,收藏Java资料网收获更多编程知识

问题:服务器java应用内存溢出。

文件:java_pid20.hprof  
大小:2.36G

目的:(在不关联具体项目代码的条件下)找出内存溢出原因


# 由于时间关系,只有精华部分,目的只是需要的时候做个引导

1、下载工具Memory Analyzer

https://eclipse.dev/mat/downloads.php

2、打开hprof文件

可直接拖进去,工具会自动Parsing heap dump 文件

3、选择分析动作

勾第一个就行,如果之前打开过有分析报告可选第三个
单击确认后会自动出来Leak Suspects(问题原因猜疑结果)

4、定位异常信息

一般第3步出的Leak Suspects 能基本定出问题相关的类及方法(这时还不是最精准的)
位置:Overview-》Reports-》Leak Suspects

如:
Keywords  
  java.lang.Object[]
  org.postgresql.core.v3.QueryExecutorImpl.processResults(Lorg/postgresql/core/ResultHandler;I)V
  QueryExecutorImpl.java:2252

5、点当前Leak Suspects页面下面的Thread Detail

能看到Thead Stack, 从中定位精准的方法:
如:
  at com.sun.proxy.$Proxy241.queryCustomerOrderList(Ljava/util/Map;)Ljava/util/List; ()
  at com.al.crm.intf.service.DetailServiceImpl.queryCustomerOrderList(Ljava/lang/String;)Ljava/lang/String; (DetailServiceImpl.java:374)
  
对应的示例:

Thead Stack:
 http-nio-8888-exec-22
  at org.postgresql.core.PGStream.receiveTupleV3()Lorg/postgresql/core/Tuple; (PGStream.java:561)
  at org.postgresql.core.v3.QueryExecutorImpl.processResults(Lorg/postgresql/core/ResultHandler;I)V (QueryExecutorImpl.java:2252)
  at org.postgresql.core.v3.QueryExecutorImpl.execute(Lorg/postgresql/core/Query;Lorg/postgresql/core/ParameterList;Lorg/postgresql/core/ResultHandler;III)V (QueryExecutorImpl.java:323)
  at org.postgresql.jdbc.PgStatement.executeInternal(Lorg/postgresql/core/CachedQuery;Lorg/postgresql/core/ParameterList;I)V (PgStatement.java:481)
  at org.postgresql.jdbc.PgStatement.execute(Lorg/postgresql/core/CachedQuery;Lorg/postgresql/core/ParameterList;I)V (PgStatement.java:401)
  at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(I)Z (PgPreparedStatement.java:164)
  at org.postgresql.jdbc.PgPreparedStatement.execute()Z (PgPreparedStatement.java:153)
  at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(Lcom/alibaba/druid/proxy/jdbc/PreparedStatementProxy;)Z (FilterChainImpl.java:3409)
  at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(Lcom/alibaba/druid/filter/FilterChain;Lcom/alibaba/druid/proxy/jdbc/PreparedStatementProxy;)Z (FilterEventAdapter.java:440)
  at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(Lcom/alibaba/druid/proxy/jdbc/PreparedStatementProxy;)Z (FilterChainImpl.java:3407)
  at com.alibaba.druid.filter.FilterAdapter.preparedStatement_execute(Lcom/alibaba/druid/filter/FilterChain;Lcom/alibaba/druid/proxy/jdbc/PreparedStatementProxy;)Z (FilterAdapter.java:1081)
  at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(Lcom/alibaba/druid/proxy/jdbc/PreparedStatementProxy;)Z (FilterChainImpl.java:3407)
  at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute()Z (PreparedStatementProxyImpl.java:167)
  at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute()Z (DruidPooledPreparedStatement.java:497)
  at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(Ljava/sql/Statement;Lorg/apache/ibatis/session/ResultHandler;)Ljava/util/List; (PreparedStatementHandler.java:56)
  at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(Ljava/sql/Statement;Lorg/apache/ibatis/session/ResultHandler;)Ljava/util/List; (RoutingStatementHandler.java:70)
  at sun.reflect.GeneratedMethodAccessor55.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; ()
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Method.java:498)
  at org.apache.ibatis.plugin.Plugin.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (Plugin.java:59)
  at com.sun.proxy.$Proxy266.query(Ljava/sql/Statement;Lorg/apache/ibatis/session/ResultHandler;)Ljava/util/List; ()
  at sun.reflect.GeneratedMethodAccessor55.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; ()
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Method.java:498)
  at org.apache.ibatis.plugin.Plugin.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (Plugin.java:59)
  at com.sun.proxy.$Proxy266.query(Ljava/sql/Statement;Lorg/apache/ibatis/session/ResultHandler;)Ljava/util/List; ()
  at sun.reflect.GeneratedMethodAccessor55.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; ()
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Method.java:498)
  at org.apache.ibatis.plugin.Plugin.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (Plugin.java:59)
  at com.sun.proxy.$Proxy266.query(Ljava/sql/Statement;Lorg/apache/ibatis/session/ResultHandler;)Ljava/util/List; ()
  at org.apache.ibatis.executor.SimpleExecutor.doQuery(Lorg/apache/ibatis/mapping/MappedStatement;Ljava/lang/Object;Lorg/apache/ibatis/session/RowBounds;Lorg/apache/ibatis/session/ResultHandler;Lorg/apache/ibatis/mapping/BoundSql;)Ljava/util/List; (SimpleExecutor.java:57)
  at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(Lorg/apache/ibatis/mapping/MappedStatement;Ljava/lang/Object;Lorg/apache/ibatis/session/RowBounds;Lorg/apache/ibatis/session/ResultHandler;Lorg/apache/ibatis/cache/CacheKey;Lorg/apache/ibatis/mapping/BoundSql;)Ljava/util/List; (BaseExecutor.java:267)
  at org.apache.ibatis.executor.BaseExecutor.query(Lorg/apache/ibatis/mapping/MappedStatement;Ljava/lang/Object;Lorg/apache/ibatis/session/RowBounds;Lorg/apache/ibatis/session/ResultHandler;Lorg/apache/ibatis/cache/CacheKey;Lorg/apache/ibatis/mapping/BoundSql;)Ljava/util/List; (BaseExecutor.java:141)
  at org.apache.ibatis.executor.CachingExecutor.query(Lorg/apache/ibatis/mapping/MappedStatement;Ljava/lang/Object;Lorg/apache/ibatis/session/RowBounds;Lorg/apache/ibatis/session/ResultHandler;Lorg/apache/ibatis/cache/CacheKey;Lorg/apache/ibatis/mapping/BoundSql;)Ljava/util/List; (CachingExecutor.java:105)
  at org.apache.ibatis.executor.CachingExecutor.query(Lorg/apache/ibatis/mapping/MappedStatement;Ljava/lang/Object;Lorg/apache/ibatis/session/RowBounds;Lorg/apache/ibatis/session/ResultHandler;)Ljava/util/List; (CachingExecutor.java:81)
  at sun.reflect.GeneratedMethodAccessor56.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; ()
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Method.java:498)
  at org.apache.ibatis.plugin.Invocation.proceed()Ljava/lang/Object; (Invocation.java:46)
  at com.al.crm.nosql.cache.ibatis.QueryCachingExecutorPlugin.intercept(Lorg/apache/ibatis/plugin/Invocation;)Ljava/lang/Object; (QueryCachingExecutorPlugin.java:114)
  at org.apache.ibatis.plugin.Plugin.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (Plugin.java:57)
  at com.sun.proxy.$Proxy265.query(Lorg/apache/ibatis/mapping/MappedStatement;Ljava/lang/Object;Lorg/apache/ibatis/session/RowBounds;Lorg/apache/ibatis/session/ResultHandler;)Ljava/util/List; ()
  at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(Ljava/lang/String;Ljava/lang/Object;Lorg/apache/ibatis/session/RowBounds;)Ljava/util/List; (DefaultSqlSession.java:101)
  at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(Ljava/lang/String;Ljava/lang/Object;)Ljava/util/List; (DefaultSqlSession.java:95)
  at sun.reflect.GeneratedMethodAccessor61.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; ()
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Method.java:498)
  at com.al.persistence.ExtSqlSessionTemplate$SqlSessionInterceptor.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (ExtSqlSessionTemplate.java:190)
  at com.sun.proxy.$Proxy48.selectList(Ljava/lang/String;Ljava/lang/Object;)Ljava/util/List; ()
  at com.al.persistence.ExtSqlSessionTemplate.selectList(Ljava/lang/String;Ljava/lang/Object;)Ljava/util/List; (ExtSqlSessionTemplate.java:92)
  at org.apache.ibatis.binding.MapperMethod.executeForMany([Ljava/lang/Object;)Ljava/lang/Object; (MapperMethod.java:124)
  at org.apache.ibatis.binding.MapperMethod.execute([Ljava/lang/Object;)Ljava/lang/Object; (MapperMethod.java:90)
  at org.apache.ibatis.binding.MapperProxy.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (MapperProxy.java:40)
  at com.sun.proxy.$Proxy240.queryCustomerOrderList(Ljava/util/Map;)Ljava/util/List; ()
  at com.al.crm.sodetail.query.bmo.SoCustomerOrderQueryBMOImpl.queryCustomerOrderList(Ljava/util/Map;)Ljava/util/List; (SoCustomerOrderQueryBMOImpl.java:38)
  at com.al.crm.sodetail.query.smo.impl.SoCustomerOrderQuerySMOImpl.queryCustomerOrderList(Ljava/util/Map;)Ljava/util/List; (SoCustomerOrderQuerySMOImpl.java:71)
  at sun.reflect.GeneratedMethodAccessor2351.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; ()
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Method.java:498)
  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (AopUtils.java:318)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint()Ljava/lang/Object; (ReflectiveMethodInvocation.java:183)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object; (ReflectiveMethodInvocation.java:150)
  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Lorg/aopalliance/intercept/MethodInvocation;)Ljava/lang/Object; (TransactionInterceptor.java:110)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object; (ReflectiveMethodInvocation.java:172)
  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Lorg/aopalliance/intercept/MethodInvocation;)Ljava/lang/Object; (ExposeInvocationInterceptor.java:90)
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object; (ReflectiveMethodInvocation.java:172)
  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (JdkDynamicAopProxy.java:202)
  at com.sun.proxy.$Proxy241.queryCustomerOrderList(Ljava/util/Map;)Ljava/util/List; ()
  at com.al.crm.intf.service.DetailServiceImpl.queryCustomerOrderList(Ljava/lang/String;)Ljava/lang/String; (DetailServiceImpl.java:374)
  at sun.reflect.GeneratedMethodAccessor2350.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; ()
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Method.java:498)
  at org.springframework.httpservice.DefHttpServiceMethodHander.invoke(Ljava/lang/Object;Ljava/lang/Object;)Lorg/springframework/httpservice/ResultDecrator; (DefHttpServiceMethodHander.java:16)
  at org.springframework.httpservice.DefHttpService.handleService(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;Lorg/springframework/httpservice/RequestFacade;)Ljava/lang/Object; (DefHttpService.java:100)
  at org.springframework.httpservice.HttpServiceExporter.handleRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V (HttpServiceExporter.java:65)
  at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/Object;)Lorg/springframework/web/servlet/ModelAndView; (HttpRequestHandlerAdapter.java:49)
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V (DispatcherServlet.java:923)
  at org.springframework.web.servlet.DispatcherServlet.doService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V (DispatcherServlet.java:852)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V (FrameworkServlet.java:882)
  at org.springframework.web.servlet.FrameworkServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V (FrameworkServlet.java:789)
  at javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V (HttpServlet.java:661)
  at javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V (HttpServlet.java:742)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V (ApplicationFilterChain.java:231)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V (ApplicationFilterChain.java:166)
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V (WsFilter.java:52)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V (ApplicationFilterChain.java:193)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V (ApplicationFilterChain.java:166)
  at com.al.crm.nosql.cache.web.ClearCacheInThread.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V (ClearCacheInThread.java:31)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V (ApplicationFilterChain.java:193)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V (ApplicationFilterChain.java:166)
  at com.linkage.bss.commons.web.filter.CharsetEncodeFilter.doFilterInternal(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljavax/servlet/FilterChain;)V (CharsetEncodeFilter.java:41)
  at com.linkage.bss.commons.web.filter.OnceRequestFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V (OnceRequestFilter.java:45)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V (ApplicationFilterChain.java:193)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V (ApplicationFilterChain.java:166)
  at org.apache.catalina.core.StandardWrapperValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V (StandardWrapperValve.java:199)
  at org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V (StandardContextValve.java:96)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V (AuthenticatorBase.java:493)
  at org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V (StandardHostValve.java:137)
  at org.apache.catalina.valves.ErrorReportValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V (ErrorReportValve.java:81)
  at org.apache.catalina.valves.AbstractAccessLogValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V (AbstractAccessLogValve.java:660)
  at org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V (StandardEngineValve.java:87)
  at org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V (CoyoteAdapter.java:343)
  at org.apache.coyote.http11.Http11Processor.service(Lorg/apache/tomcat/util/net/SocketWrapperBase;)Lorg/apache/tomcat/util/net/AbstractEndpoint$Handler$SocketState; (Http11Processor.java:798)
  at org.apache.coyote.AbstractProcessorLight.process(Lorg/apache/tomcat/util/net/SocketWrapperBase;Lorg/apache/tomcat/util/net/SocketEvent;)Lorg/apache/tomcat/util/net/AbstractEndpoint$Handler$SocketState; (AbstractProcessorLight.java:66)
  at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(Lorg/apache/tomcat/util/net/SocketWrapperBase;Lorg/apache/tomcat/util/net/SocketEvent;)Lorg/apache/tomcat/util/net/AbstractEndpoint$Handler$SocketState; (AbstractProtocol.java:808)
  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun()V (NioEndpoint.java:1498)
  at org.apache.tomcat.util.net.SocketProcessorBase.run()V (SocketProcessorBase.java:49)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V (ThreadPoolExecutor.java:1149)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run()V (ThreadPoolExecutor.java:624)
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run()V (TaskThread.java:61)
  at java.lang.Thread.run()V (Thread.java:748)

6、看Top Consumers

Overview-》Actions-》Top Consumers

7、Biggest Objects

点第一行(出来菜单)--》Java Basics-》Thread Overview and Stacks

8、展开第一行-》找到Numeric最多的那行再展开
一般可以看到前面几行包含 第 4 步中类:QueryExecutorImpl 关键字


这里注意:
   1、当前页面的堆栈信息列表就像平常打印的异常堆栈一样,最前面的是最底层的方法。
   2、可以看到Numeric最大的行在前面3行中
   3、不要展开Numeric最大的行,因为不需要,而且会很卡
   4、一般按默认排序的情况下展开第一个空Numeric上面的那行就行了
   5、本文示例(第一个空Numeric上面的那行)展开后可以看到  preperedQuery

 

9、 preperedQuery下面key的值为问题对应的sql,右键copy出来如下:

select co.cust_order_id as custOrderId,
        co.cust_so_number as custSoNumber,
        co.staff_id staffId,
        (select s.staff_name from staff s where s.staff_id = co.staff_id) staffName,
        to_char(co.accept_time, 'YYYY-MM-DD HH24:mm:ss') acceptTime,
        co.status_cd statusCd,
        (select os.name from order_status os where os.status_cd = co.status_cd) statusName,
        to_char(co.status_date, 'YYYY-MM-DD HH24:mm:ss') statusDt,
        co.channel_id channelId,
        (select channel_name from channel c where c.channel_id = co.channel_id) channelName,
        (select cust_number from cust where cust_id = co.cust_id) custNumber,
        (select name from cust c1 where c1.cust_id = co.cust_id) custName
        from customer_order co
        where 1=1
    and co.distributor_id = cast(? as DECIMAL)

图示:

10、 preperedParameters下面paramValues的值为sql对应的参数

本示例只有一个参数,参数值为:100000031

图示:

本示例内存溢出的原因:该sql查询结果数据量过大导致。
解决方案:分页查询、增加条件分批查询等。

总结完毕!

最后,感谢燕飞的分享~

其他分析工具

JProfiles


https://www.ej-technologies.com/download/jprofiler/files

VisualVM


https://visualvm.github.io/download.html


文章来源:https://blog.csdn.net/jjk_02027/article/details/135024648
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:jacktools123@163.com进行投诉反馈,一经查实,立即删除!

标签:

相关文章

本站推荐

标签云