Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Memory leak in Import?' topicStudent Support Forum > General > "Memory leak in Import?"

Next Comment >Help | Reply To Topic
Author Comment/Response
Ze Manel
10/03/09 09:54am

When importing an image/document in Mathematica 7, used memory keeps on growing. E.g. try:

Table[Import["file.pdf"], {30}];

where "file.pdf" is a test pdf file in your work directory.
Look at the memory used by the Kernel before and after the command.
Now repeat the previous line and watch it grow again.

This is not good, or something desirable, since we're really not assigning these imported files to any variable, so they shouldn't take up any more memory than the first import.
Importing a file once or 100 times should occupy the same memory if there are no assignemnts/stored values.

This wasn't an issue in Mathematica 5, but I keep facing this and similar memory management issues in Mathematica 7.

Which leads me to believe that perhaps Mathematica is now somehow storing previous outputs in memory, even those not printed or assigned to? If that is the case, how can one disable it?

Unless I know what is going on, so as to have control over memory use, this is a nightmare for anyone writing nontrivial packages/code.

Thanks for your help.


URL: ,

Subject (listing for 'Memory leak in Import?')
Author Date Posted
Memory leak in Import? Ze Manel 10/03/09 09:54am
Re: Memory leak in Import? yehuda ben-s... 10/05/09 11:14am
Re: Re: Memory leak in Import? Ze Manel 10/05/09 2:58pm
Next Comment >Help | Reply To Topic