hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Parvu <spa...@systemdatarecorder.org>
Subject Re: HTTPCORE memory leak on simple server implementation
Date Mon, 15 Feb 2010 16:09:27 GMT
> 
> When I start the server on Solaris platform and I start sending on it,
> with a remote httpClient, the http requests,  this is the output I can
> see:
> 
> >java -cp ./httpServerExample.jar:./httpcore-4.0.1.jar:
> ElementalHttpServer
> Listening on port 21000
> 
> Incoming connection from /10.10.10.176
> New connection thread
> Incoming entity content (bytes): 29155635
> Client closed connection
> 
> Looking at the memory with "prstat" I can observe that it increase
> without release the resource allocated. It increase for each message the
> http Server receive.
> After the first http request it increase from 30M to 86M, after the
> second from 86M to 142M, then raise up to 199M....until a java heap
> exception is raised.
> The incoming request throughput is quite low (1 message every 10
> seconds) 
>

First of all make sure you define a -Xms and -Xmx range
for your Java options and maybe a properl Young/Perm generation
and ensure you have a proper heap geometry. Then try to
use pmap and check the heap segment if you really suspect a
memory leak.

Example of pmap from a 32bit process:

0808A000      24K   4K rw---    [ heap ]
08090000       4K    - rw---    [ heap ]
08091000       4K   4K rw---    [ heap ]

what java are you using and what version ? What solaris ?


> How can i avoid this memory behaviour?
>

Could it be a bug on your application ? Try to measure 
with pmap the anon segments, these will be your JVM consumed
resources from Heap.

stefan


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message