[SciPy-user] Memory problems with stats.mannwhitneyu

Robert Kern robert.kern@gmail....
Thu Jul 26 16:53:14 CDT 2007

Martin Blom wrote:
> I need to do lots and lots of mannwhitneyu-tests and my programs keep
> running out of memory so something is wrong somewhere. When I run, for
> example,
> from scipy.stats import mannwhitneyu
> x = [2,4,8,3]
> y = [1,3,5,6]
> while True:
>     u,p = mannwhitneyu(x,y)
> and run top to look at the memory used by python it just keeps
> increasing until I run out. Does anyone who understands the inner
> workings of the stats module know what's happening? Or is it that my
> little loop doesn't release memory in some way? I've been using
> mannwhitneyu for some time now, and I haven't noticed the problem until
> now, which might mean that I've had enough memory to get by until now or
> that there is a recent error, which seems unlikely when I look at the
> changelog.

That is odd. I don't see this on numpy 1.0.3, recentish scipy SVN (maybe up to a
week ago), Python 2.5.1, Intel Mac OS X. Both your code and the code for
mannwhitneyu() look fine to me.

Can you give us similarly-detailed information about the platform you are
running on? If you used binary builds, also please let us know where you got
them from, too. We have had problems in the past with numpy not freeing memory
for array scalars, but I think that was before the 1.0 release.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the SciPy-user mailing list