ws-xmlrpc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Peierls <>
Subject Re: cleanup in XmlRpcServer.Worker
Date Sat, 26 Jan 2002 05:49:36 GMT
Daniel Rall wrote:
> Hi Tim.  I've committed code implementing the general idea behind your
> patch to CVS.  Thanks much!

You're welcome. 

I notice you left the byte[] result as a field rather than make it a
local variable. Though it won't make any difference for small responses,
it is still a potential memory leak if the responses get very large. Is
there some other reason to use a field here?

Come to think of it, the use of setLength(0) to clear the StringBuffer
is a bit risky. There is no guarantee that setLength releases any
memory. Maybe it would be better simply to allocate a new StringBuffer
for each execute?

Same reasoning applies to the argument Vector, in theory, but in this
case the "leak" is proportional to the number of arguments, which is
unlikely to be significant, unlike the StringBuffer and byte array. So
what you did with removeAllElements() seems like the right choice to me.

Speaking of Vector: Now that there is language in the README that
suggests a Java version requirement of 1.2+, is it time to switch from
Vector to List, and from Hashtable to Map? I brought this up almost two
years ago (,
but at the time many folks were counting on 1.1 compatibility.


View raw message