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
6
votes
0answers
75 views

Memory usage for smallest eigenvalues

I have a bunch of hermitian matrices which are huge (of order 2^17 x 2^17) but extremely sparse so that, when I build the matrices, the usage of RAM is low (say of order 1 GB or similar). The ...
2
votes
0answers
25 views

Optimising tensor operations under memory constraints

Let riem is a free variable with riem ∈ Arrays[{4, 4, 4, 4} as assumption. Let: ...
0
votes
1answer
32 views

How to plot a greyscale image as a 3D plot for larger images?

I was following the post: Display grayscale image as 3d plot But the method failed for any image of substantial size (in my case when the data size is of order 3072x4096). Ram usage on my machine ...
1
vote
1answer
32 views

Excessive usage of memory while using ArrayFlatten or Flatten

I have 16 NxN matrices, where N can be anywhere between 1000-64000.. Some of them are real and some of them are complex. I want to Reshape then to form a 4Nx4N matrix. When I try to accomplish this ...
5
votes
2answers
293 views

How to solve this problem 710 of Project-Euler

I want to solve this problem: The number 6 can be written as a palindromic sum in exactly eight different ways: (1,1,1,1,1,1),(1,1,2,1,1),(1,2,2,1),(1,4,1),(2,1,1,2),(2,2,2),(3,3),(6) We ...
14
votes
0answers
275 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 ...
0
votes
0answers
47 views

FrameTicks custom function throws “MemoryAllocationFailure”

A simple function for FrameTicks returns memory errors when working with large powers of 10. ...
14
votes
1answer
514 views

How to constrain memory usage on HPC?

I found the performance of built-in function MemoryConstrained is very poor. It stops the evaluation after the memory limit has already been exceeded greatly than ...
1
vote
2answers
78 views

How to calculate total time and memory of computation

Is there a way to check how much time and memory it takes for calculation in Mathematica 9? I have a code where it takes about 1-2 minutes before it shows the output. I want to print the exact time ...
7
votes
1answer
184 views

Efficient storage of large non-rectangular arrays

I need to store in memory an array of the form a=Table[Tuples[{1, 2, 3}, {n}], {n, 1, MaxLength}] When MaxLength larger than - say - 20, this obviously results ...
1
vote
1answer
83 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
42 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
32 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
58 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
34 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
123 views
12
votes
0answers
424 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
26 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
69 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
65 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
138 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
30 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
110 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
411 views
3
votes
0answers
84 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 ...
14
votes
1answer
219 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 ...
0
votes
1answer
79 views

Mathematica quits its calculations automatically

I am trying to plot the ListPlot3D but mathematica quits calculations without any warning or error. ...
7
votes
0answers
91 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: ...
22
votes
1answer
226 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 ...
0
votes
0answers
46 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 ...
34
votes
3answers
2k views

How to clear parts of a memoized function?

I have a function of two variables, e.g.: f[a_, b_] := f[a, b] = something f[a - 1, b - 1] etc With the above code I used the concept of memoization to speed up ...
2
votes
0answers
99 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
36 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 ...
2
votes
0answers
54 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
55 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 ...
7
votes
3answers
367 views

Reading a file as a ByteArray?

I want to read in large files as byte strings. Import[..., "Byte"] yields a list of Integers that takes up much more space (16 times more) than the file. ...
14
votes
1answer
220 views

Is this memory leak in VertexDelete a bug?

Bug introduced in 9.0 or earlier and fixed in 12.0 Test the below function: ...
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
57 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
76 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: ...
10
votes
2answers
1k views

Memory running out generating ContourPlot3D

The code below ...
1
vote
0answers
180 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 ...
4
votes
1answer
112 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: ...
2
votes
0answers
32 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
38 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
2answers
407 views

How does this code behave with more than 32GiB RAM? [closed]

The point here is to test how many bits are reserved in a 64-bit kernel for the reference count. For example, ByteCount[5] reports 16 bytes for a machine integer; ...

1
2 3 4 5
7