Questions about RAM usage, including optimizing memory use, avoiding and fixing leaks and releasing unused memory.

learn more… | top users | synonyms

1
vote
0answers
40 views

Does Sum calculate all terms before summing them?

After calculating the sum of a large number of large objects, using B = Sum[RandomInteger[{0, 1}, {10^6}], {100}]; I find that ...
0
votes
2answers
38 views

Notebook cells space on disk profiler

I have one single notebook with more than 500 mb... To control its growth, I would like to have a profiler of used space (not the live memory, but the space on disk), in such a way that I can easily ...
4
votes
0answers
79 views
+50

NMinimize with NIntegrate (crash in symbolic evaluation, memory leak)

This is a "common" problem from what I've seen, but with a different spin. I have a function I use often that finds a fit of an expression to another expression with some free parameters (e.g. for ...
2
votes
1answer
63 views

Pros/Cons to updating in place

There are often times when I have to update a list. The following is an example: ...
2
votes
1answer
68 views

Memory usage optimization for a large Association/SparseArray

Reformulating my question in simpler terms. Take two lists list1 = RandomInteger[{1, 100000000}, 25000000]; list2 = RandomReal[{1, 10}, 25000000]; Make an ...
1
vote
0answers
57 views

Should I Remove the initial symbols of Module?

Often we use Module to construct complicate function. Consider that Module create new vars every time we run the function, should I remove the initial values at the end of Module-function?Or should I ...
0
votes
0answers
97 views

Out of Memory Error

I am currently constructing matrices, but I'm having problems with memory. When I evaluate some cells, the kernel quits due to lack of memory. I tried ...
0
votes
0answers
64 views

Handling really large Arrays (by possibly using lower precision) [duplicate]

I know there have been a few questions about efficient memory storage on mathematica.stackexchange, but I could not find a sufficient answer for my problem (except that it might not work at all). So ...
3
votes
2answers
95 views

memory management in Mathematica

Unlike using Unprotect[In,Out]; Clear[In,Out]; Protect[In,Out]; to clean the occupied memory of the whole notebook, I want to clean the memory dynamically and ...
1
vote
0answers
43 views

ImageAssemble and Export gif takes too much memory

Errr.... First Let's create some gifs: ...
1
vote
0answers
66 views

Out of memory problem on constructing large list in Mathematica running on Linux

I have Mathematica running on Mac as well as Linux, my Mac as 16GB of RAM with core i5 processor (2-core) and Linux has 24GB of RAM on i7 (4-core). The problem is that the following command: ...
0
votes
1answer
80 views

How do I manage my memory better when using the Map function?

So I'm attempting to write a Mathematica program that prints a range of natural numbers as the sum of four cubes. I wrote the following Mathematica code to try this, but am running into a memory ...
0
votes
0answers
121 views

Constructing and Reducing Tuples in a Memory Efficient Manner

This question is extension of a question I started here: Reduce the output from tuples by including symmetry? and will focus on higher order arrays and issues of optimization (similar to what I've ...
2
votes
0answers
57 views

Memory used by SparseArray objects

In dealing with a quantum mechanics problem, I am representing some many-body states in two different ways in Mathematica. For two parameters n and ...
1
vote
2answers
78 views

Table of ParametricPlots crashes Kernel

I can usually crash the Mathematica Kernel by using Table to generate a List of ...
4
votes
0answers
91 views

Memory leak when looping over FindInstance in version 10.0.0

When I run the following (simplified) code with FindInstance, my MemoryInUse is constantly increasing: ...
1
vote
0answers
80 views

SystemException[MemoryAllocationFailure] with Memoized function

Version 10.1 Win7x64 Enterprise. This is more of a report than a question but others may have seen the same / have insights. I have some code (that I can't really post as it's too big) with a large ...
9
votes
1answer
124 views

ListConvolve Memory Hemorrhage

I wrote a routine that convolves an impulse response array with a test array and checks for the RMS difference between that convolution and a data array. I do this iteratively so that I can modify the ...
1
vote
4answers
106 views

calculating subsets of a matrix (L=40X40)

I need to calculate all $k$-possible subsets$(k:1,L)$ of matrix with size $L$. I am using subset function as following, ...
2
votes
1answer
134 views

mathematica use too much memory to Import large dat file

Err... When I try to Import a .dat file by dat = Import["D:\\TIEGCM\\solar_input\\omni_m_all_years.dat", "Table"]; or ...
3
votes
1answer
123 views

Memory leak in MemberQ

Bug introduced in 10.0.0 and fixed in 10.0.2 Consider the following code. ...
0
votes
1answer
69 views

What is stored in the kernel's memory

I disabled "Show Suggestions Bar after last output" in the preferences. I begin my code with $HistoryLength = 0. After running my code, I run the following. ...
5
votes
1answer
103 views

Comparing memory consumption of two pieces of code

I have implemented something I want to do in two different ways, because I'm not sure which of the two approaches give best speed/memory efficiency. Comparing the speed of the two approaches is ...
3
votes
2answers
95 views

Memory Problem with Modules and NDSolve

I'm using NDSolve inside a module, and I appear to have a memory leak. The relevant code is: ...
-1
votes
2answers
155 views

Want to compute the permutations of {1, 2, …, 11} with only 3 GB of memory [duplicate]

There is another way to calculate Permutations [{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}] without triggering an error, I have 3 GB of RAM with WIN 7 Edit: This ...
2
votes
0answers
46 views

Does Mathematica support out-of-core Associations?

I often find myself collecting data in an Association[] which outgrows my computer's main memory. Does Mathematica support any out-of-core equivalent? Ideally, I ...
0
votes
0answers
142 views

Is there a way to give Mathematica extra memory?

I am running Mathematica 10 (Student Edition) on Mac OS X 10.7.5 on an old Mac Pro. I have lots of extra RAM that the system isn't touching, and I would like to give some of it to Mathematica in the ...
8
votes
0answers
104 views

What is stored in FrontEnd memory?

I quit the kernel, and closed all notebooks, leaving only the startup window. Yet when I open a new notebook, MemoryInUse[$FrontEnd] reveals that the FrontEnd still ...
1
vote
0answers
81 views

Avoid copying memory for each subkernel

Here is a simplified example illustrating my issue; ...
2
votes
1answer
91 views

Simple-looking Minimize takes for ever

Consider the following: Minimize[{(ξ - x)^2 + (η - y)^2, a ξ + b η == c}, {ξ, η}, Reals] After asking Mathematica to do this yesterday afternoon and forgetting ...
10
votes
0answers
140 views

How can the Theil-Sen estimator be made to work on larger datasets?

The Theil-Sen estimator finds the slope and intercept of a line passing through a set of points by calculating the median slope and median intercept of the set of lines passing through all possible ...
4
votes
1answer
91 views

Is there a way to constrain the memory used for a notebook (session)?

I know that we can constrain the memory usage of certain computation using MemoryConstrained. Is there a way to constrain the memory of each cell evaluation during ...
5
votes
1answer
214 views

Largest matrix size supported by Mathematica 10

I have need to store large square matrices in memory, some times sparse, some times not. I have used up to $2^{15}$ by $2^{15}$ as my upper bound so far, and Mathematica has handled it even if it took ...
7
votes
2answers
108 views

Compress uses too much memory and sometimes crashes the Kernel

Using Compress is a good idea to save memory when working with large expressions. The problem is that Compressing large ...
21
votes
1answer
507 views

Excessive memory use by Mathematica kernel in 10.0.2 after executing simple commands

Update: The issue has been fixed in Mathematica 10.1! :) Warning: the code below may hang your system if you have the Suggestions Bar enabled in Mathematica < 10.1. When issuing the ...
0
votes
0answers
113 views

What is the largest system of PDE you have solved with Mathematica?

I need to solve a system of partial differential equations. In the simplest case it consists of 2000 of PDE equations. In the most complex situation it consists up to 1 million of such equations. ...
5
votes
1answer
218 views

Table and memory efficiency

Consider these two types of creating matrices: Table[Table[i*j,{i,1,10}],{j,1,10}] Table[i*j,{i,1,10},{j,1,10}] I want to know if there is any difference ...
3
votes
1answer
135 views

How to know each variable used how much RAM

Is it possible to know what percentage of total used RAM by MMA is used by individual variables? I want to know how the total used RAM is distributed among different variables. ...
10
votes
2answers
682 views

Rendering thousands of points

I am trying to render an image with some 120,000 Points. Technically it's just 10,000 points, plus their reflection, plus 5 rotations of both of those sets, but I'm ...
1
vote
0answers
131 views

Fast export of large numerical data

Edit It seems that the bottelneck is not due to eigen value problem. I will esit the question soon. I have a 6000by6000 matrix which I got after some calculations. I want to get the eigenvalues and ...
2
votes
0answers
55 views

How to use nest to reduce the memory eatting of mma?

I enconter a problem about number: If we have 5+3+2=151022 9+2+4=183652 8+6+3=482466 5+4+5=202541 then 7+2+5=? It is easy to get the first two group of numbers? for the ...
0
votes
1answer
83 views

FindMinimum runs out of Memory

I have a function (its rather long, but does not matter) which when evaluated (1000s of times) runs fine. However, when I try to find its optimal parameters using ...
2
votes
2answers
54 views

Large Tuples with Negative Integers

I am trying to run a loop that cycles through the elements of Tuples[{-1,0,1},116] and terminates when a desired result is found. Unfortunately, this creates a memory problem due to 116. All of ...
15
votes
1answer
323 views

Why does this line increase the consumed memory?

Probably this is a simple question, however I really don't understand this behavior in Mathematica. It particularly leads to a memory leak in a huge program I have to do processing of 3D images. I ...
10
votes
2answers
241 views

Is there a way to control V10's undo length?

This may be a duplicate (if so I will remove this), but I was having trouble finding the relevant bit of documentation to fix it. I noticed that my FrontEnd memory ...
1
vote
0answers
159 views

Mathematica using all available RAM [closed]

I want to fit a function with 100 parameters. When I use FindMinimum, Mathematica uses all the 24GB RAM in my PC and ultimately crashes. However, if I use ...
3
votes
0answers
118 views

Increasing MaxPoints in NDSolve results in memory issue

I am interested in increasing "MaxPoints" in NDSolve's "MethodOfLines" in attempt to increase the resolution of the plot of the solution of linearly damped wave equation with transparent boundary ...
1
vote
1answer
138 views

How smart is Solve? Figuring out what tricks I should try

I'm trying to solve a large system (~10000) of linear equations using Solve, but the process keeps failing. As-is, I don't know whether it's failing because it's using too much memory or too much time ...
2
votes
0answers
46 views

distributing definitions in an .m file and memory

I am dealing with a huge table stored in an .m file of size 4 GBs. Somehow when I call the table in .nb file it seems the memory increases not by 4 GBs but more than 10GBs (roughly checking from task ...