jerqi commented on PR #2058:
URL:
https://github.com/apache/incubator-uniffle/pull/2058#issuecomment-2370353110
> Sorry, I write it wrongly. Below is the netty source code. If we set
DIRECT_MEMORY_LIMIT to not a big number, will throw OutOfDirectMemoryError. But
the jvm process will not exit, but the ByteBuf will be leaked.
>
> ```
> private static void incrementMemoryCounter(int capacity) {
> if (DIRECT_MEMORY_COUNTER != null) {
> long newUsedMemory = DIRECT_MEMORY_COUNTER.addAndGet(capacity);
> if (newUsedMemory > DIRECT_MEMORY_LIMIT) {
> DIRECT_MEMORY_COUNTER.addAndGet(-capacity);
> throw new OutOfDirectMemoryError("failed to allocate " +
capacity
> + " byte(s) of direct memory (used: " +
(newUsedMemory - capacity)
> + ", max: " + DIRECT_MEMORY_LIMIT + ')');
> }
> }
> }
> ```
Maybe it's ok to add comments to merge this pull request.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]