Message Boards Message Boards

0
|
6444 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

How do I free memory after ListConvolve operation

3 Replies

Hello David and Alexay,

thanks for your suggestions! However, none of them changed the outcome.

Then I updated from 10.0.2 to 10.2.0 and now the issue is gone! I am also working with Win7 Pro x64.

Thanks again for your replies!

Max

Hello, Maximilian! Maybe, using "$HistoryLength=1" - can solve your problem? Inform me, please...

Posted 9 years ago

Hi Max,

On my Win7 Pro x64, Mathematica 10.2.0, your ListConvolve does not appear to leak memory. MemoryInUse is pretty much the same after each of the 10 iterations, and in the kernel it uses less memory that the ImageConvolve. However, consolidating memory is done by the function Share[].

Best, David

In[1]:= k = GaussianMatrix[{50, 5}];
a = Table[x1 = Array[0 &, {1000, 1000}];
   (x1[[Sequence @@ #]] = 1) & /@ (RandomInteger[999, {100, 2}] + 1);
   x2 = ListConvolve[k, x1, {51, 51}];
   x3 = Image[x2];
   Print[MemoryInUse[]], {10}];

During evaluation of In[1]:= 43397800

During evaluation of In[1]:= 43398104

During evaluation of In[1]:= 43398248

During evaluation of In[1]:= 43398392

During evaluation of In[1]:= 45485456

During evaluation of In[1]:= 45485456

During evaluation of In[1]:= 45485456

During evaluation of In[1]:= 45485456

During evaluation of In[1]:= 45485456

During evaluation of In[1]:= 45485456

In[3]:= (* kernel *) MemoryInUse[]

Out[3]= 45350272

In[4]:= MemoryInUse[$FrontEnd]

Out[4]= 140931072

In[5]:= k = Image[GaussianMatrix[{50, 5}]];
a = Table[x1 = Array[0 &, {1000, 1000}];
   (x1[[Sequence @@ #]] = 1) & /@ (RandomInteger[999, {100, 2}] + 1);
   x2 = Image[x1];
   x3 = ImageConvolve[x2, k];, {10}];
MemoryInUse[]

Out[7]= 55257384
POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract