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.

io.netty.util.internal.OutOfDirectMemoryError

See original GitHub issue

Actual behavior

io.netty.util.internal.OutOfDirectMemoryError - failed to allocate 16777216 byte(s) of direct memory (used: 3456106503, max: 3464495104) 200 B (0%) n/a

Netty version

4.1.16.Final

JVM version (e.g. java -version)

1.8.0_152

OS version (e.g. uname -a)

Linux

1 2 3

Four weeks after netty uptime, I’m experiencing CPU spikes that once happen they stay high. Then, netty server fails to accept an amount of 10-20% of incoming connections. I captured the threads that consume the most cpu and I found the exception they were throwing was io.netty.util.internal.OutOfDirectMemoryError.

Also before this I’m experiencing garbage collection issues once a week, system hangs unless I call manually System.gc() from a remote administration panel that uses another netty bootstrap instance for the admin client. Therefore the memory is heavily used but always goes down after full gc.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
normanmaurercommented, Feb 15, 2018

@jo-kin yes… you may try writing faster then the remote peer accepts… You can check Channel.isWritable() to see if it is writable atm. ChannelInboundHandler.channelWritabilityChanged(...) will be triggered whenever the writability state of the Channel changes

0reactions
waterWangcommented, Jun 16, 2021

DataBufferUtils.release(buffer);

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to find a root cause of the following netty error: io.netty.util ...
How to find a root cause of the following netty error: io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) ... I've ...
Read more >
Netty client (io.netty.util.internal.OutOfDirectMemoryError)
io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 16777216 byte(s) of direct memory (used: 922746880, max: 928514048).
Read more >
OutOfDirectMemoryError (Netty API Reference (4.1.85.Final))
OutOfMemoryError that is throws if PlatformDependent.allocateDirectNoCleaner(int) can not allocate a new ByteBuffer due memory restrictions.
Read more >
OutOfDirectMemoryError (Netty/Common 4.1.43.Final API)
OutOfMemoryError that is throws if PlatformDependent.allocateDirectNoCleaner(int) can not allocate a new ByteBuffer due memory restrictions. See Also: ...
Read more >
Logstash io.netty.util.internal.OutOfDirectMemoryError: failed ...
It usually means the last handler in the pipeline did not handle the exception. io.netty.util.internal.OutOfDirectMemoryError: failed to ...
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