OutOfMemory in HttpClient

jaimemm jaimemm at gmail.com
Mon Jan 19 06:19:12 EST 2009


Hi,

I've tried all the possible combinations, and the only change I noticed it's
the amount of messages I could send before running out of memory.

All the responses are coming and the channels are being closed, but no luck,
still the memory keeps growing and growing. Tried to call even a System.gc
but not memory is freed at all until the command
"factory.releaseExternalResources()" is called. 

Looks like there's some memory leak somewhere.


Wesly smith wrote:
> 
> Gee... you asked a very similar question like mine.
> 
> In my case, I set the NIO selector loop number too high, such as 160
> below, and I sent in 1M content size message from client, and it caused
> out-of-message on my setup.
>   ChannelFactory factory = 
>     new NioClientSocketChannelFactory( 
>         Executors.newCachedThreadPool(), 
>         Executors.newCachedThreadPool(), 160); 
> 
> But after I switch the default numbers (usually, the jvm pick up the core
> numbers if you don't specify it), and I didn't see the out-of-memory
> problem after I punched 100000 messages with each client message having
> ChannelBuffer 1024x1024 bytes.
> 
> 
> 
> jaimemm wrote:
>> 
>> Taking the HTTP Client server example and including into a loop, to send
>> N messages, the connection &  send message logic, the memory consumption
>> raises over 500mb for just 700 messages (10Kb each) which causes the
>> OutOfMemoryException. Am I doing something wrong? is there any piece of
>> code susceptible of memory leaking? What should I check?
>> 
>> thanks
>> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/OutOfMemory-in-HttpClient-tp2170142p2180828.html
Sent from the Netty User Group mailing list archive at Nabble.com.




More information about the netty-users mailing list