[Java] learning – memory overflow experience

【Https://www.toutiao.com/i6595365358301872643/

Preface

OutOfMemoryError Problem I believe many friends have encountered, compared to common business anomalies (array boundaries, null pointers, etc.) such problems are difficult to locate and solve.

This paper focuses on the location and solution of a recent online memory overflow problem, hoping to bring ideas and help to students who encounter similar problems.

Mainly from the performance of –> check –> locate –> solve four steps to analyze and solve problems.

Appearance

Recently, an application on our production has been constantly exploding memory overflows, and with the growth of traffic occurs more and more frequently.

The business logic of the program is very simple, which is to consume data from Kafka and do persistence operations in batches.

The phenomenon is that the more frequent the Kafka message, the faster the abnormal frequency will appear. Because there were other things to do at the time, Operations and Maintenance had to be restarted and the heap memory and GC were monitored.

It is good to restart the big law, but it still can not solve the problem at all.

Check up

So we want to try to determine where the problem is based on the memory data collected before the operation and maintenance, GC logs.

A memory overflow investigation was conducted on Posted on Categories DB, default

Leave a Reply

Your email address will not be published. Required fields are marked *