On 01 Jan 2016, at 21:43, Kevin Burton <burto...@gmail.com> wrote:I think that unpooled/direct byte buffers might actually be harmful.The way anonymous direct buffers are releases (at least on Java 7... I didn't test this on Java 8 yet but I'm seeing similar behavior) is that they're only released on GC.
The problem comes in when you create too many buffers , still have plenty of JVM memory, but not enough OS memory.
At this point you run out of memory and you get OOM killed.You could use pooled of course, and set a cap on the amount of direct memory you will use.Which leaves me with 2 questions:- how do you set pooled as the default in 4.0..?
- should unpooled really be the default?
We tested this in production and found that our proxy setup requires a LOT of memory before running into memory problems. 4-8GB ... this is primarily because (at least I hypothesize) Java GC isn't coming in and freeing memory in time and the OS has no memory left to spare.
--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/d9826745-a5ea-46f8-8886-dbd1bd35f65a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Yes that is still true in Java 8. If you ask me I think the whole idea of manager off-heap memory with a Garbage Collector is not going to fly, but that is just how it is :(
That said this only fix one of the problems as the problem still is that the method is static synchronized which means it is a big bottleneck.
-Dio.netty.allocator.type=pooledOr you can also set on the Bootstrap / ServerBootstrap.
--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/d399e950-6524-4419-ab6b-fa3d52cb28fe%40googlegroups.com.