文本已收录至我的GitHub仓库,欢迎Star:github.com/bin39232820…
种一棵树最好的时间是十年前,其次是现在
我知道很多人不玩qq了,但是怀旧一下,欢迎加入六脉神剑Java菜鸟学习群,群聊号码:549684836 鼓励大家在技术的路上写博客
本来打算是准备着一支烟 一杯咖啡 一个bug写一天的,但是一来公司,运维就把昨天生产线的日志怼过来说,线上报错了。。。
2020-03-24 03:35:39.486 ERROR --- [ForkJoinPool.commonPool-worker-0] com.hq.tiku.sync.bw.listener.ClassPlainListenter Line:101 - 同步消息队列push.userClassplan.tiku出现异常ClassPlanEntity(classplanId=2c7cc389822b4181a591c9890a2d3eeb, teacherId=276, teacherName=陈文文, teacherTeam=null, userId=18658702, className=2020年初级冲剌班, courseId=2900, courseNo=2020005CJ, courseName=2020年初级会计实务冲刺阶段, classplanName=2020年初级会计实务(冲刺阶段), classId=5864, tkUserId=null, courseTkNo=null, planNum=null) org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is io.lettuce.core.RedisException: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 855638016 byte(s) of direct memory (used: 985661440, max: 1823473664) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:74) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41) at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44) at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42) at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:257) at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.convertLettuceAccessException(LettuceStringCommands.java:718) at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.set(LettuceStringCommands.java:143) at org.springframework.data.redis.connection.DefaultedRedisConnection.set(DefaultedRedisConnection.java:231) at org.springframework.data.redis.core.DefaultValueOperations$3.inRedis(DefaultValueOperations.java:202) at org.springframework.data.redis.core.AbstractOperations$ValueDeserializingRedisCallback.doInRedis(AbstractOperations.java:59) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184) at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95) at org.springframework.data.redis.core.DefaultValueOperations.set(DefaultValueOperations.java:198) at com.hq.tiku.sync.bw.listener.ClassPlainListenter.lambda$synClassPlan$0(ClassPlainListenter.java:92) at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) at java.util.stream.Nodes$ArrayNode.forEach(Nodes.java:684) at java.util.stream.ForEachOps$ForEachOrderedTask.onCompletion(ForEachOps.java:490) at java.util.concurrent.CountedCompleter.tryComplete(CountedCompleter.java:577) at java.util.stream.ForEachOps$ForEachOrderedTask.onCompletion(ForEachOps.java:505) at java.util.concurrent.CountedCompleter.tryComplete(CountedCompleter.java:577) at java.util.stream.ForEachOps$ForEachOrderedTask.onCompletion(ForEachOps.java:505) at java.util.concurrent.CountedCompleter.tryComplete(CountedCompleter.java:577) at java.util.stream.ForEachOps$ForEachOrderedTask.doCompute(ForEachOps.java:483) at java.util.stream.ForEachOps$ForEachOrderedTask.compute(ForEachOps.java:400) at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) Caused by: io.lettuce.core.RedisException: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 855638016 byte(s) of direct memory (used: 985661440, max: 1823473664) at io.lettuce.core.LettuceFutures.awaitOrCancel(LettuceFutures.java:125) at io.lettuce.core.FutureSyncInvocationHandler.handleInvocation(FutureSyncInvocationHandler.java:62) at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80) at com.sun.proxy.$Proxy227.set(Unknown Source) at org.springframework.data.redis.connection.lettuce.LettuceStringCommands.set(LettuceStringCommands.java:141) ... 23 common frames omitted 复制代码
上面是报错的信息,这个模块是一个同步模块,代码同事写的,就是把一些数据通过mq同步到数据库去,上面报错的就是因为堆外内存不够了,failed to allocate 855638016 byte(s) of direct memory (used: 985661440, max: 1823473664)
首先我定位到代码处,把代码拿出来康康
在Rediss操作的时间报错了,然后网上各种百度,还真没找到具体的原因,不过自己定位了个大概。觉得有以下可能
其实也没啥,就是自己记录一下一些东西,哈哈。不过有大佬碰到的可以下面留言哦。
好了各位,以上就是这篇文章的全部内容了,能看到这里的人呀,都是真粉。
创作不易,各位的支持和认可,就是我创作的最大动力,我们下篇文章见
六脉神剑 | 文 【原创】如果本篇博客有任何错误,请批评指教,不胜感激 !