tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: Problem with threads in stage Service (Tomcat 7.0.14)
Date Fri, 29 Jul 2011 08:29:16 GMT
On 29/07/2011 08:41, André Warnier wrote:
> Pid wrote:
>> On 28/07/2011 20:07, Alejandro Henao González wrote:
>>> I dont believe that have GC running all the time, but the GC is
>>> called in the above line to HTMLEncoder.encode. as follows.
>>> System.gc();
>>> resultado = htmlEncoder.encode(resultado); 
>>
>> Is 'htmlEncoder' a static field, an instance field or defined inside the
>> method scope?
>>
>>> response.reset(); 
>>
>> Why are you resetting the response?
>>
>>
> I'm not the real Java specialist here, but maybe one isn't really needed
> here.
> The code above seems to suggest that this application is forcing a major
> garbage collection at every request (or more).  Is there a need to look
> anywhere else as to why this Tomcat is saturating the host's CPU and why
> threads are always suspended ?
> 
> (Philip already pointed this out, but maybe he wasn't forceful enough in
> making the point)

The GC will cause problems, yes.

I am wondering whether the htmlEncoder is thread-safe too.
The response.reset() may be superfluous.

Just a little extra help...


p


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


Mime
View raw message