Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Off-heap memory leak. I'm not sure if it's a grpc-spring problem or a netty problem. #1123

Open
hakusai22 opened this issue Jul 2, 2024 · 1 comment
Labels
question A question about this library or its usage

Comments

@hakusai22
Copy link

hakusai22 commented Jul 2, 2024

Using top -c to check RES memory usage, it was 1.2g on Friday and rose to 1.5g on Monday. Using pmap to check 1539536kb (1.5g), and turning on NMT to check jcmd -p VM.native_memory detail, the total committed memory is 1152483kb (1g). The difference is 377MB. These are all off-heap memories that JVM cannot monitor. The off-heap memory block data at the memory address 00007xxxx has increased, and it is suspected to be an off-heap memory leak. Checking the dump file, it is found that the classes related to off-heap memory are io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueue and io.grpc.netty.shaded.io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueue

Below are the memory leak data analyzed by grpc version, netty version and mat tool

        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
            <version>1.53.0</version>
        </dependency>

        <grpc.spring.version>2.14.0.RELEASE</grpc.spring.version>

            <!-- grpc -->
            <dependency>
                <groupId>net.devh</groupId>
                <artifactId>grpc-client-spring-boot-starter</artifactId>
                <version>${grpc.spring.version}</version>
            </dependency>
            <dependency>
                <groupId>net.devh</groupId>
                <artifactId>grpc-server-spring-boot-starter</artifactId>
                <version>${grpc.spring.version}</version>
            </dependency>
  • io.netty.buffer.PoolThreadCache$SubPageMemoryRegionCache
image
  • io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueue
image image image

img_v3_02ca_9c8c2390-341d-471d-901e-9f1655b3707g

image image image
@hakusai22 hakusai22 added the question A question about this library or its usage label Jul 2, 2024
@yanan-wyze
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question A question about this library or its usage
Projects
None yet
Development

No branches or pull requests

2 participants