# Questions tagged [memory]

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

341 questions
Filter by
Sorted by
Tagged with
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 ...
25 views

### Optimising tensor operations under memory constraints

Let riem is a free variable with riem ∈ Arrays[{4, 4, 4, 4} as assumption. Let: ...
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 ...
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 ...
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 ...
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 ...
47 views

### FrameTicks custom function throws “MemoryAllocationFailure”

A simple function for FrameTicks returns memory errors when working with large powers of 10. ...
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 ...
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 ...
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 ...
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 ...
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 ...
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: ...
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 *) ...
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:...
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 ...
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 ...
123 views

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

I've the following code: ...
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: ...
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 (...
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: ...
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,...
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,...
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 ...
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. ...
411 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: ...
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 ...