MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Memory leak

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27879] Re: [mg27868] Memory leak
  • From: maarten.vanderburgt at icos.be
  • Date: Fri, 23 Mar 2001 04:31:01 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Carl,

I see exactly the same in Mathematica 4.1 under Windows NT.

Maarten
Leuven





"Carl K. Woll" <carlw at u.washington.edu> on 22-03-2001 10:30:08 AM

cc:

Subject: [mg27879]  [mg27868] Memory leak



Hi all,

I have recently come across the following command which leaks memory,
and thought that it might be of interest to the Mathematica community.
To check for memory leaks in a statement, I run the following commands:

Print[{MemoryInUse[],MaxMemoryUsed[]}];
Do[ statement;
    Print[{MemoryInUse[],MaxMemoryUsed[]}], {10}]

If statement has no memory leak, then each of the print statements above
should be the same (except for the first couple). For a simple statement
like 1+1 this is indeed the case. However, when using the Drop command
with more than one sequence specified, each of the print statements
increases by 32 bytes on my system, which is Mathematica 4.0 on Windows
NT. For example,

Print[{MemoryInUse[],MaxMemoryUsed[]}];
Do[ Drop[{{1,2},{3,4}},-1,1];
    Print[{MemoryInUse[],MaxMemoryUsed[]}], {10}]

will demonstrate this memory leak. If only one sequence specification is
given, like Drop[{{1,2},{3,4}},-1] then no memory leak occurs. Feel free
to comment on whether this is an accurate gauge of a memory leak, and
whether your system also experiences this leak.

Carl Woll
Physics Dept
U of Washington







  • Prev by Date: Re: Cylindrical to helix transformation
  • Next by Date: Re: Evaluating large polynomials over Z_p
  • Previous by thread: Memory leak
  • Next by thread: Re: Memory leak