Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: release memory

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98320] Re: release memory
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Mon, 6 Apr 2009 04:59:59 -0400 (EDT)

On 4/5/09 at 6:38 AM, summertan at hotmail.com (summer) wrote:

>Here is an example program that fails to release the memory:

>In[1]:= $HistoryLength = 0;
>tbl = Table[{r, t}, {t, 0, 1, 1/1000}, {r, 0, 1, 1/1000}];
>ByteCount[tbl]
>MemoryInUse[]

>Out[3]= 188 184 024

>Out[4]= 94 058 160

>In[5]:= ClearAll[tbl]; MemoryInUse[]

>Out[5]= 9 885 560

>First notice that the numbers shown by ByteCount and MemoryInUse are
>inconsistent ???

ByteCount returns the memory needed to store a given expression.
MemoryInUse returns the total memory store all data in the
current kernel session. These are simply not the same things.
Clearly, what is occurring here is there is memory being used in
addition to that needed to store the data for tb1 that is not
released when you clear tb1.

>Anyways, after ClearAll, the MemoryInUse decreased with about 85 MB
>indeed but Windows Task Manager does not show any decrease of the
>used RAM memory, nor increase in the free memory ....

I would assume the Windows Task Manager reports the memory
allocated from Windows to Mathematica There is no way for a
system level tool to know how memory allocated to an application
is used by that application. The functions Clear, ClearAll etc
free memory for subsequent use in Mathematica. This doesn't mean
that memory is returned to the system. Which means Windows Task
Manager still sees the same memory being used by Mathematica.




  • Prev by Date: Re: release memory
  • Next by Date: Re: Plot3D, show and text
  • Previous by thread: Re: release memory
  • Next by thread: Re: release memory