bladex服务访问mysql数据库,报Java heap space错误

Blade 未结 1 808
153934475
153934475 剑圣 2021-10-26 11:10

一、该问题的重现步骤是什么?

1. 服务链接数据库有问题,经常断开,无法链接,业务无法正常

2. 

3.


二、你期待的结果是什么?实际看到的又是什么?

希望能够给与建议,做一些改进。


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

spring cloud 2.8.2,在centos7.8上,mysql: 5.7.35,目前数据量某几个表大概在500w,系统操作用户数大概100人。经常做一些导入,数据更新插入操作。

四、请提供详细的错误堆栈信息,这很重要。

 Error querying database.  Cause: java.sql.SQLException: Java heap space

### The error may exist in org/springblade/validation/mapper/InputPdDMapper.java (best guess)

### The error may involve defaultParameterMap

### The error occurred while setting parameters

### SQL: SELECT id, uuid, area_code, county_code, channel_code, policy_no, premium_sum, insurant, insurant_id_card, insurant_mobile, insurant_rank, policy_holder, policy_id_card, policy_mobile, policy_rank, vesting_person, operators, vehicle_inspector, plate_number, vehicle_identification_number, order_tools, risk_name, risk_code, signing_date, starting_date, ending_date, input_date, input_risk_type, handle_status, rdaa_code, adaa_code, cover_company_code, cover_company_name, survey_company_name, survey_people_name, loss_date, record_date, closed_date, vin_code, loss_people_code, loss_people_name, create_user, create_dept, create_time, update_user, update_time, status, is_deleted FROM INPUT_PD_D WHERE is_deleted = 0 AND (area_code >= ?)

### Cause: java.sql.SQLException: Java heap space

; Java heap space; nested exception is java.sql.SQLException: Java heap space

        at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:110)

        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)

        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)

        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)

        at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:91)

        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)

        at com.sun.proxy.$Proxy159.selectList(Unknown Source)

        at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)

        at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:173)

        at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:78)

        at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)

        at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)

        at com.sun.proxy.$Proxy177.selectList(Unknown Source)

        at com.baomidou.mybatisplus.extension.service.IService.list(IService.java:279)

        at com.baomidou.mybatisplus.extension.service.IService$$FastClassBySpringCGLIB$$f8525d18.invoke(<generated>)

        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

        at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:119)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)

        at org.springblade.validation.service.impl.InputPdDServiceImpl$$EnhancerBySpringCGLIB$$a8c96887.list(<generated>)

        at org.springblade.validation.feign.AreaErrorPdDClient.getListByCode(AreaErrorPdDClient.java:61)

        at org.springblade.validation.feign.AreaErrorPdDClient$$FastClassBySpringCGLIB$$1dc94745.invoke(<generated>)

        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)

        at org.springblade.core.log.aspect.RequestLogAspect.aroundApi(RequestLogAspect.java:112)

        at sun.reflect.GeneratedMethodAccessor390.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)

        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)

        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)

        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)

        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)

        at org.springblade.validation.feign.AreaErrorPdDClient$$EnhancerBySpringCGLIB$$74d24854.getListByCode(<generated>)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)

        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)

        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)

        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878)

        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792)

        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)

        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)

        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)

        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)

        ... 59 common frames omitted

Caused by: java.sql.SQLException: Java heap space

        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)

        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)

        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)

        at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)

        at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)

        at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3461)

        at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440)

        at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:3459)

        at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:167)

        at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497)

        at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)

        at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)

        at sun.reflect.GeneratedMethodAccessor379.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)

        at com.sun.proxy.$Proxy261.query(Unknown Source)

        at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:69)

        at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325)

        at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)

        at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81)

        at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)

        at com.sun.proxy.$Proxy256.query(Unknown Source)

        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)

        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)

        at sun.reflect.GeneratedMethodAccessor387.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at java.lang.reflect.Method.invoke(Unknown Source)

        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)

        ... 111 common frames omitted

2021-10-25 22:13:32.187  INFO 1 --- [   async-task-6] c.netflix.loadbalancer.BaseLoadBalancer  : Client: blade-log instantiated a LoadBalancer: DynamicServerListLoadBalancer:{NFLoadBalancer:name=blade-log,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null

2021-10-25 22:13:32.190  INFO 1 --- [   async-task-6] c.n.l.DynamicServerListLoadBalancer      : Using serverListUpdater PollingServerListUpdater

2021-10-25 22:13:32.201  INFO 1 --- [   async-task-6] c.n.l.DynamicServerListLoadBalancer      : DynamicServerListLoadBalancer for client blade-log initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=blade-log,current list of Servers=[10.100.0.28:80],Load balancer stats=Zone stats: {unknown=[Zone:unknown; Instance count:1;       Active connections count: 0;    Circuit breaker tripped count: 0;       Active connections per server: 0.0;]

},Server stats: [[Server:10.100.0.28:80;        Zone:UNKNOWN;   Total Requests:0;       Successive connection failure:0;        Total blackout seconds:0;       Last connection made:Thu Jan 01 08:00:00 CST 1970;      First connection made: Thu Jan 01 08:00:00 CST 1970;   Active Connections:0;   total failure count in last (1000) msecs:0;     average resp time:0.0;  90 percentile resp time:0.0;    95 percentile resp time:0.0;    min resp time:0.0;      max resp time:0.0;    stddev resp time:0.0]

]}ServerList:com.alibaba.cloud.nacos.ribbon.NacosServerList@cddf1cbf

2021-10-25 22:14:31.869  INFO 1 --- [  XNIO-1 task-3] o.s.core.log.aspect.RequestLogAspect     : 


五、若有更多详细信息,请在下面提供。

1条回答
  • 检查下你参数是不是有设置,sql查询的数据是不是太大了,内存溢出了。

    0 讨论(1)
提交回复