Questions tagged [memory]

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

Filter by
Sorted by
Tagged with
11
votes
0answers
211 views

Why is MemoryInUse[] Very Different from the Actual Amount of Memory Being Used?

I call the MemoryInUse[] function, and it outputs about 256 Megabytes. MemoryInUse[] (*255979528*) However, my activity ...
1
vote
1answer
79 views

Manage to save large arrays

Some time ago I asked the following question: Merge list repeating elements I was easily answered and I was satisfied by the answer. However in computing such combinatorics, I saturated the RAM very ...
0
votes
0answers
38 views

High Memory Usage in Parallel but No CPU Usage

I am simplifying an expression in Mathematica in parallel. The memory usage is exploding. It seems that Mathematica is creating many Kernels which have no CPU usage, but considerable RAM usage (see ...
0
votes
0answers
30 views

Is this a good way to measure percentage of total available memory used?

I'd like to know how much I'm using of the total memory Mathematica has available but I've found no built in function that would tell me this, so I've came up with this pretty straightforward formula: ...
0
votes
0answers
32 views

After execution of simple list manipulation every expression turns dark blue and nothing is defined - how to debug

This question is related to this one in the sense that it uses the code from there. What happens is best illustrated in the video here. When I run (* part 1 *) ...
3
votes
0answers
54 views

Reading through file one line at a time, running out of RAM [closed]

I have a handful of files (some of which are very large), and I would like to loop through them one line at a time, run a calculation, and then write the result of the calculation to a new output file:...
4
votes
1answer
110 views

Deleting a specific In[ ] / Out[ ] pair

I recently found that the CleanSlate package allows you to free memory without restarting the Wolfram kernel. The CleanSlate package includes the ClearInOut, which ...
4
votes
0answers
30 views

Monitoring memory consumption

I have a complex Mathematica program that runs in a continuous loop and performs certain calculations on data. The program consists of multiple packages each with a number of functions (usually ...
2
votes
2answers
118 views

Finding a program that can find integer solutions for large values of a variable

I've the following code: ...
12
votes
0answers
406 views

Why does Mathematica consume so much memory when reading binary data?

There are somewhat similar questions on here, but I didn't find a satisfying answer for this case: I import a 1.7 GB binary data file using the following command: ...
0
votes
0answers
25 views

Export to ExpressionML extreme memory consumption

I have a big variable, data, that is (roughly) a large list of polynomials in x with numerical coefficients at high precision (...
4
votes
1answer
67 views

Reduce memory cost with three matrices multiplication

My program is eating up all my RAM and the operation is related to 3 matrices multiplication, as the code shown below. example code: ...
1
vote
1answer
63 views

Notebook to run on batches of files

I have a notebook that Imports files from a folder and processes and stores outputs into another folder. It works well with small number of files, however, when there's a large number of input files,...
10
votes
1answer
125 views

Memory leak with FindMaximum/Minimum inside of Module

This is my first question here. I have to solve coupled first order ODE-s and find the maximum of a function which depends on the solution of the ODE. I have to do this calculation in large quantities,...
0
votes
0answers
28 views

Sequential production of Eigenvectors?

I have to deal with very large matrices in Mathematica (dimensions $10^4\times10^4$ at least). Obtaining the eigenvalues of these matrices is not so difficult since, it is not memory intensive or ...
3
votes
1answer
105 views

Recursive solution to the extended Josephus problem [duplicate]

The Josephus Problem is described here, with extension of killing every $k$th problem. In the simple case where every other person is killed, we can also use the binary trick. ...
6
votes
2answers
402 views

Is it possible to Clear (recover memory from) a specific index to a variable, while leaving other indices to the same variable untouched?

Consider the following method commonly used to clear a typical variable: ...
3
votes
0answers
82 views

Is there a maximum amount of RAM Mathematica can manage?

We are performing full diagonalization of large matrices using Mathematica, in order to study certain statistical measures of eigenstates in certain problems of quantum physics. We have been using ...
0
votes
1answer
76 views

Mathematica quits its calculations automatically

I am trying to plot the ListPlot3D but mathematica quits calculations without any warning or error. ...
14
votes
1answer
214 views

Memory leak in the system function: how to free memory without restarting the kernel?

$HistoryLength = 0; Warming up: TextSentences[StringJoin@RandomChoice[Join[Alphabet["Russian"], {" ", "."}], 100]]; No ...
7
votes
0answers
84 views

Possible NetTrain[] memory leak when training in GPU

I've just moved to Mathematica 12.0 (from 11.3) and sometimes NetTrain[] will fail with the following error: ...
0
votes
0answers
42 views

CoefficientRules for huge expressions

Is there some idea to get the coefficients for a very complicated, huge, and explicit polynomial expression to avoid insufficient memory problem? I am trying to use GroebnerBasis`DistributedTermsList ...
22
votes
1answer
224 views

Possible Memory Leak Issues in NestWhile

Consider the following code snippet: NestWhile[{#[[1]]+1,Pause@.001;ConstantArray[0,{100, 100}]}&, {1}, (#[[1]] <= 10000) &, 2] In theory, when ...
2
votes
0answers
96 views

Mathematica running out of RAM while executing NDSolve

I am playing with Mathematica to solve the 2D-wave equation with the code below: ...
0
votes
0answers
34 views

Triangulations of a convex polygon

I have a piece of code which finds all triangulations of a convex polygon. It is known that a number of such triangulations for a given $n$-gon is is given by ($n-2$)th Catalan Number, so for instance,...
6
votes
1answer
1k views

Computing elements of a 1000 x 60 matrix exhausts RAM

I am trying to compute a 1000 x 60 matrix or list of lists (and ideally this should go up to 1000 x 500 or 1000 x 1000). Each element is the result of a FindRoot ...
0
votes
0answers
29 views

SystemException[“MemoryAllocationFailure”] with long evaluation involving FindRoot

I had earlier posted my code in a previous question, but I am reposting my code here: ...
2
votes
0answers
53 views

How to use SPARQLExecute for SPARQLSelect on Entities?

When using SPARQLSelect on Entity Types the entire entity store is downloaded to the local cache. For example, ...
2
votes
0answers
54 views

MemoryAllocationFailure: Finding 90% Confidence ellipses for 2d PDFs with *tiny* densities

I'm trying to find a 90% confidence ellipse for a complicated, and tiny "Gaussian-esque" PDf. These pdf is the result of many, many ugly marginalizations and transformations so I can't quite list the ...
1
vote
0answers
71 views

Memory leak in simple program

I am trying to solve a simple optimization problem on the sphere, and for some reason, I got some memory leak that I am not able to solve. To decompose the problem in step, what I wan to do is Take ...
4
votes
0answers
56 views

SystemException[“MemoryAllocationFailure”] with DSolve and using TimeConstrained

Report to WRI CASE:4238154 There is a similar question where SystemException["MemoryAllocationFailure"] is generated by DSolve ...
2
votes
0answers
68 views

Simplifying long expressions leads to memory allocation failure

I am currently trying to manipulate a number of expressions into a particular form that will allow me to determine their poles and zeros: ...
1
vote
0answers
152 views

How can I efficiently call an external Python script that needs to run continuously?

I am writing a Mathematica program that tries to run 100+ Python programs, via StartProcess[], continuously. It seems to work when I run < 100 programs, but, at ...
2
votes
0answers
29 views

How to iterate over Orbit of PermutationGroup?

Another day, another permutation group question. I'm given a g=PermutationGroup[...], and a list l={1, 3, 3, 2, ...}. I know I ...
2
votes
0answers
64 views

Memory leak in SmithDecomposition?

While trying to compute a large number of Smith decompositions in Mathematica 11.0 under Windows 10, my computer keeps running out of memory for no apparent reason. Here is a self-contained example ...
0
votes
0answers
35 views

How can I get an array of very large primes when I don't have a lot of memory?

I would like to perform computations on an array of primes within the range $[2,10^{15}]$. For the moment, I am selecting such an array using the command: ...
2
votes
0answers
62 views

Memory leakage when exporting “.mov” files

I am using Mathematica 11.3 with Windows 10. When calling Export to export a List of Images as a QuickTime movie, the memory used by Mathematica 11.3 increases ...
4
votes
1answer
111 views

Memory consumption problem when reading png images with Image`ImportExportDump`ImageReadPNG

For importing png images I use often: image = First@Image`ImportExportDump`ImageReadPNG[fileName] (see: ?*`*PNG*) since this is faster than: ...
3
votes
1answer
74 views

Prevent MMA from saving results in Out[] [duplicate]

MMA automatically saves every result which then can be called via Out[] where the argument needs to be given as %n and ...
20
votes
1answer
673 views

Generating and rendering extremely large graphs

I'm interested in generating and rendering extremely large graphs, i.e., ones having $10^6 \to 10^8$ vertices. (These graphs will ultimately be rendered in PDF or PNG and printed on large, poster-...
5
votes
0answers
68 views

How to prevent the message: Not enough memory to display a cell

While running a single-cell GUI application that repeatedly changes and refreshes its content I got this message: There was not enough memory to display a cell... I found in this old MathGroup thread ...
0
votes
1answer
54 views

How to optimize this script?

fx8350, 16Gb ram just need to solve this: 13, 19, 19, 16, 26, 33, 26, 31, 5, 24, 21, 34, 35, 35, 35, 20, 7, 12, 18, 17, 6, 8, 15, 24, 2, 17, 15, 22, 29, 15, 21
4
votes
1answer
229 views

estimation of values using NMaximize over symbolic array entries

I'm trying to generate instances of a dataset that satisfy specific conditions, based on the following equation: Each of four non-zero terms (term 1, A; term 3, B; term 4, C; term 5, D) is a scalar. ...
0
votes
0answers
102 views

Mathematica quits kernel with a beep sound on MacBook Pro (2015)

Mathematica sometimes quits kernel while I'm trying to plot a bunch of eigenvalues of a matrix vs some parameter, accompanied by a beep sound. It didn't used to do this at all, so I don't think its ...
3
votes
0answers
52 views

How can I prevent ParallelTable[] from freezing?

I have spent some time trying to figure this out. I have a function that appears to be the reason my program is freezing. I am using both MemoryConstrained[] and <...
3
votes
2answers
205 views

Schrödinger equation for a hydrogen atom and lack of memory

I'm trying to solve the Schrödinger equation for a hydrogen atom in the Cartesian coordinate system. This is my code ...
3
votes
1answer
100 views

SystemException[“MemoryAllocationFailure”] with compile and speed issues

I am trying to run a code that gives out a matrix but, I seem to encounter some memory issues while trying to run it. The code is: ...
0
votes
1answer
122 views

Increasing the speed of sparse array

I am trying to find a sparse matrix of the size Col x Rows = 16777216 x 1024 where all the elements are 0 except the ones given ...
6
votes
1answer
142 views

Clever caching of a recursively defined function

I've got a function of the form f[n,s] where n is a natural number and s is a finite ...
5
votes
1answer
119 views

How do computational resources required for NDSolve scale with integration time?

In a nutshell I have a large system of ODE. When I integrate the system from x = 0 to x = dx, ...

1
2 3 4 5
7