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

io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1OnReady occupy too much memory #11770

Open
lulu2panpan opened this issue Dec 22, 2024 · 2 comments
Labels

Comments

@lulu2panpan
Copy link

lulu2panpan commented Dec 22, 2024

my grpc verseion is :<grpc.version>1.30.0</grpc.version>
my question is :io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1OnReady occupy too much memory

 num     #instances         #bytes  class name (module)
-------------------------------------------------------
   1:        166890     1899695256  [B ([email protected])
   2:      56705537     1360932888  java.util.concurrent.ConcurrentLinkedQueue$Node ([email protected])
   3:      56705251     1360926024  io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1OnReady
   4:         29061       26383648  [Ljava.lang.Object; ([email protected])
   5:         13494        8852064  io.grpc.netty.shaded.io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueue
   6:           857        4990072  [C ([email protected])
   7:         28351        2590160  [J ([email protected])
   8:         93460        2243040  java.lang.String ([email protected])
   9:         28646        1833344  io.grpc.netty.shaded.io.netty.buffer.PoolSubpage
  10:         65536        1572864  com.aliyun.polardbx.binlog.dumper.dump.logfile.parallel.EventData
  11:         12101        1445832  java.lang.Class ([email protected])
  12:         42613        1363616  java.util.concurrent.ConcurrentHashMap$Node ([email protected])
截屏2024-12-21 22 17 11 截屏2024-12-21 22 17 28
@lulu2panpan
Copy link
Author

Haha, I encountered this problem three years ago,but i forgot it,should do my logic in another thread

#7839
#7361

@ejona86
Copy link
Member

ejona86 commented Dec 26, 2024

Yes, blocking the callback thread the way you were can accumulate onReady() callbacks. There could be some ways to fix it in gRPC, but it isn't probably worth it given how pathological your approach is (you don't even learn if the RPC died, because onClose() can't be called).

You should take a look at 1.70 though (the next release), because we merged #10318 which has a blocking API for streaming. That will probably yield much better results than hard-coded polling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants