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.

Direct Memory Leak on 1.31.1

See original GitHub issue

when I use grpc-java 1.31.1 ,then an error occured. detail msg as follow

Caused by: io.grpc.netty.shaded.io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 2097152 byte(s) of direct memory (used: 534774039, max: 536870912)
	at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.incrementMemoryCounter(PlatformDependent.java:742)
	at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.allocateDirectNoCleaner(PlatformDependent.java:697)
	at io.grpc.netty.shaded.io.netty.buffer.PoolArena$DirectArena.allocateDirect(PoolArena.java:758)
	at io.grpc.netty.shaded.io.netty.buffer.PoolArena$DirectArena.newChunk(PoolArena.java:734)
	at io.grpc.netty.shaded.io.netty.buffer.PoolArena.allocateNormal(PoolArena.java:245)
	at io.grpc.netty.shaded.io.netty.buffer.PoolArena.allocate(PoolArena.java:227)
	at io.grpc.netty.shaded.io.netty.buffer.PoolArena.allocate(PoolArena.java:147)
	at io.grpc.netty.shaded.io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:356)
	at io.grpc.netty.shaded.io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:187)
	at io.grpc.netty.shaded.io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:123)
	at io.grpc.netty.shaded.io.grpc.netty.NettyWritableBufferAllocator.allocate(NettyWritableBufferAllocator.java:51)
	at io.grpc.internal.MessageFramer.writeKnownLengthUncompressed(MessageFramer.java:227)
	at io.grpc.internal.MessageFramer.writeUncompressed(MessageFramer.java:168)
	at io.grpc.internal.MessageFramer.writePayload(MessageFramer.java:141)
	at io.grpc.internal.AbstractStream.writeMessage(AbstractStream.java:65)
	at io.grpc.internal.ForwardingClientStream.writeMessage(ForwardingClientStream.java:37)
	at io.grpc.internal.DelayedStream.writeMessage(DelayedStream.java:252)
	at io.grpc.internal.ClientCallImpl.sendMessageInternal(ClientCallImpl.java:544)
	at io.grpc.internal.ClientCallImpl.sendMessage(ClientCallImpl.java:528)
	at io.grpc.stub.ClientCalls$CallToStreamObserverAdapter.onNext(ClientCalls.java:364)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
YifeiZhuangcommented, Sep 13, 2022

Is it possible that you are sending large messages at a high frequency? RPCs will queue waiting to be sent, and if you > queue too many you will see such out of memory errors.

If you are doing unary RPCs, you may consider limiting yourself to X concurrent RPCs (note this is different from the server’s max concurrent). If doing streaming RPCs you can observe flow control.

similar issues seem frequent, e.g. #2710.

0reactions
ejona86commented, Sep 26, 2022

Seems like this is resolved. If not, comment, and it can be reopened.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failing to understand how to fix this memory leak
I'm creating a small solver that takes three arguments: number of hours, current time and true time. The program itself works fine, but...
Read more >
Direct Buffers Memory leak in 3.3.1 #6942 - GitHub
The application very quickly causes memory issues and starts dropping requests before eventually failing. Below are some of our grafana graphs, ...
Read more >
Unboxing BusyBox - 14 new vulnerabilities uncovered ... - JFrog
Background. Embedded devices with limited memory and storage resources are likely to leverage a tool such as BusyBox, which is marketed as ...
Read more >
Memory Leaks
An indirect leak is a heap object that is reachable by a pointer to its start address, but with all such pointers originating...
Read more >
10 Tips for using the Eclipse Memory Analyzer - EclipseSource
As we've shown, the Eclipse Memory Analyzer has a lot of tools to help track both memory leaks and excessive memory use. While...
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