Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Simple program leaking memory - why?
Replies: 4   Last Post: May 13, 2013 3:47 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
gredner@gmail.com

Posts: 2
Registered: 5/7/13
Simple program leaking memory - why?
Posted: May 7, 2013 3:53 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi folks,

I'm fighting an issue in which a simple Mathematica program to export a bunch of plots is leaking a huge amount of memory - enough to exhaust the 12G available on my machine. The problem is, it looks like the program should run in bounded memory! A simplified version of my code which demonstrates the problem follows:

====================
n = 10000;
(* just some bogus data *)
makeData[_] := Table[{{x, y} = RandomReal[{-3, 3}, {2}], {y, -x}}, {200}];
data = Array[makeData, n];
ParallelMap[
Export[
"movie-" <> IntegerString[#, 10, 4] <> ".png",
ListVectorPlot[data[[#]]]] &,
Range[1, n]];
====================

The problem occurs whether the loop is Map or Do, Parallel- or not. It occurs in Mathematica 8 and 9, both under Linux.

The amount of memory leaked per frame is considerable - approximately .6 MB in my tests. I don't see where it could be going, unless Export is caching every byte which passes through it!

I've also asked this question on stackexchange [1] but so far nobody has a clue.

Thanks,
-Gabe

[1] http://mathematica.stackexchange.com/questions/24461/why-does-this-simple-program-leak-memory




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.