question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Heap memory leak caused OOM

See original GitHub issue

BUG REPORT

  1. 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.

  1. Please tell us about your environment:

JDK 1.8 spring-boot 2.3.2.RELEASE rocketmq-spring-boot-starter 2.2.2

  1. 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.

7cb9dde8227a7e2f8da406ed9759ae8 78cb0c26671ee0ee1628c9dfec7f6ec

27d2c64a317ddfa49d408a1cc15ad2f 9930d024336a2496a084664380b49f3

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
panzhi33commented, Aug 3, 2022

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.

0reactions
panzhi33commented, Aug 3, 2022

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’

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found