[Snowball-discuss] Re: Possible memory leak in Snowballs Java stemmer (Richard Boulton)

Richard Boulton richard@tartarus.org
Mon Jun 7 11:28:02 2004


Chris Cleveland wrote:
> I missed the original message about Java and memory problems, but
> I've done a fair amount of thinking about how the Java code could be
> re-architected. Here are the difficulties with the current system:

Most of your suggestions make some sense to me, though I can't see how 
to implement some of them.  I have no time to implement changes to the 
Java stemmers, anyway.  If you put together a patch (diff -u format, 
please), I would be happy to review it, and include it if appropriate.

I understand that reflection is considered slow and inefficient - which 
is a shame, since it's a very nice language feature.  I don't quite 
follow how you propose to remove it.  The Among structure reflects one 
of the features of the snowball language, and I can't see how to reflect 
this feature without use of such a structure.  When implemented in C, 
the among structure contains a function pointer: the reflection used in 
the Among class in java does the same job - calling a function in the 
snowball program (see the Finnish stemmer for an example of a stemmer 
which uses this callback feature).

Anyway, a patch would make all your suggestions clear.

-- 
Richard