Heap memory leak caused OOM
See original GitHub issueBUG REPORT
- Please describe the issue you observed:
Heap memory leak caused OOM.
- What did you do (The steps to reproduce)?
@Slf4j
@Component
@RocketMQMessageListener(topic = "${rocketmq.consumer.topic}"
, consumerGroup ="${rocketmq.consumer.group}")
public class EventListener implements RocketMQListener<Event>, RocketMQPushConsumerLifecycleListener {
@Override
public void prepareStart(DefaultMQPushConsumer consumer) {
consumer.setMaxReconsumeTimes(5);
consumer.setPullThresholdForTopic(200);
consumer.setPullThresholdSizeForTopic(100);
}
@Override
public void onMessage(Event message) {
log.info("The event listener: {}", JSON.toJSONString(message));
}
}
- What did you expect to see?
Message consumption is normal.
- What did you see instead?
Messages are being consumed, but the old zone is also accumulating.
- Please tell us about your environment:
JDK 1.8 spring-boot 2.3.2.RELEASE rocketmq-spring-boot-starter 2.2.2
- Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
ps_old_gen always unable to release, after holding for 1-2 days, OOM will occur.
Issue Analytics
- State:
- Created a year ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
How we find and fix OOM and memory leaks in Java Services
There can be several causes for memory leaks. We will discuss the most common ones here. The first and probably most easily overlooked...
Read more >What is the difference between OOM and memory leaks in Java?
OOM stands for Out Of Memory error. This is an error thrown by Java VMs (virtual machine) when they run out of heap...
Read more >Understanding Memory Leaks in Java - Baeldung
A Memory Leak is a situation where there are objects present in the heap that are no longer used, but the garbage collector...
Read more >Managing an OutOfMemory Exception Caused by Thread ...
A thread leak is causing a memory shortage at the server, which will cause the JVM process to throw out an OOM error....
Read more >3.2 Understand the OutOfMemoryError Exception
Cause: The detail message Java heap space indicates object could not be allocated in the Java heap. This error does not necessarily imply...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Look at the stack information, use litePull, the above code uses push. litePull needs to take the initiative to pull it. If you don’t take the initiative to pull the cancellation fee, it will cache a large number of ConsumeRequest objects.
Is litePull also used when using rocketmq-client ? DefaultLitePullConsumerImpl caches a large number of ConsumeRequest objects, and ConsumeRequest also holds message objects,the reason is still consume slowly. can search rocketmq_client.log for ‘The consume request count exceeds’