[undertow-dev] Undertow client and ByteBuffer pools

Stuart Douglas sdouglas at redhat.com
Sun Nov 22 16:06:38 EST 2015


One possibility is to just use a shared pool between all components (there is no real disadvantage to this, under super high load you may end up with slightly higher contention but this is unlikely to be a problem in reality). 

You could also try using heap buffers instead of direct buffer (change the 'true' to 'false' when creating the pool). It may be that your JVM does not have a large amount of direct buffer memory available. 

Stuart

----- Original Message -----
> From: "James Netherton" <jnethert at redhat.com>
> To: undertow-dev at lists.jboss.org
> Sent: Wednesday, 18 November, 2015 3:48:22 AM
> Subject: [undertow-dev] Undertow client and ByteBuffer pools
> 
> Hi,
> 
> I've been tinkering with the Apache Camel Undertow component. The Camel
> producer makes use of UndertowClient for HTTP requests. I end up getting
> OutOfMemoryError exceptions when running the test suite where the producer
> has been invoked around 25 - 30 times.
> 
> I think the way in which the UndertowClient is being configured is
> sub-optimal. For example, for each producer that's started it creates a
> (pretty large) ByteBufferSlicePool.
> 
> https://github.com/apache/camel/blob/master/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowProducer.java#L130
> 
> Which is then used in the client.connect() call whenever the producer runs:
> 
> https://github.com/apache/camel/blob/master/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowProducer.java#L80
> 
> What's a better, more efficient way of configuring this?
> 
> Cheers,
> 
> James
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev
> 


More information about the undertow-dev mailing list