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

learn more… | top users | synonyms

6
votes
1answer
130 views

Is there a version of Together that doesn't cancel common factors?

I'm running code that produces a long combination of rational functions with free constants that need to be tuned such that the combination vanishes. My current method is to put the combination over ...
16
votes
2answers
271 views

Module trash collection behaviour

I have asked this question before on the Wolfram community forum (http://community.wolfram.com/groups/-/m/t/83845?p_p_auth=Gxoxe65B) but not with great success. Module creates temporary variables of ...
5
votes
1answer
81 views

Does Share have any side effect?

According to the documentation, Share[expr] changes the way expr is stored internally, to try and minimize the amount of ...
15
votes
1answer
300 views

Unpacked eigenvectors of complex matrices

Edit: This bug is fixed in Mathematica 10.0.0 I want to calculate eigenvectors of a Hermitian matrix. For example ...
0
votes
0answers
65 views

kernel shuts down during listplot [duplicate]

In at least the following situations, I have experienced that the kernel has shut down during evaluation. The thing is that there is no message at all when it shuts down. ...
1
vote
0answers
87 views

NMinimize memory consumption problem in Mathematica 9 vs. 7 & 8

I am having trouble using NMinimize in Mathematica 9 - Memory consumption overflows. The same NMinimize command, with the same ...
4
votes
1answer
106 views

Memory usage of timeseries - lists of {Integer32, Real32}

A list of {Integer32, Real32} items in Mathematica seems to use 12-times as much memory than the C equivalent array of structs. ...
1
vote
0answers
53 views

Memory Leak while running Animate/Manipulate/Export [duplicate]

While looking into building a simulation for an ant colony, I started encountering some memory leakage issues. ...
6
votes
0answers
220 views

How can I find the source of a memory leak?

I found a really weird issue using NDSolve`ProcessEquations inside module. We start by setting HistoryLength to 0. After this we define a function which takes in an integer and creates a Table of ...
5
votes
0answers
270 views

NDSolve and memory usage

After some googling, i've found similar problems around, but didn't find a 100% satisfactory answer, so let me ask here: I'd like to solve a 1+1 problem using the method of lines. In spherical ...
4
votes
0answers
172 views

Memory problem with producing complex graphics of general type

The problem I am about to ask has appeared once here: Memory Leak in Frontend - anyone know a workaround?. However, in this question I would like to put it in a bit different context. Problem recipe: ...
20
votes
4answers
435 views

Running out of memory when partitioning an image with ImagePartition

I have an Image3D object of image type "Bit16" with the dimensions 1472 x 1472 x 1472 that I would like to split into small image cubes of dimension 64 x 64 x 64 ...
2
votes
0answers
184 views

Clearing memory of a subkernel in a Do loop

I have a Do loop, which saves data directly to a .txt file. However when I leave it running for long periods of time the RAM ...
2
votes
1answer
75 views

Strange response with dynamic texture and MousePosition

I built a cubic, then use MousePosition together with GUIScreenShot to take a floating region with fixed size (200*200) on the ...
1
vote
0answers
169 views

CUDALink ran out of available memory

I have a problem with automatic GPU memory management when using CUDA. The situation is the following: I create a simple CUDA function that operates on a 2D array (image), which does not take much ...
2
votes
2answers
201 views

How to pick out specific parts of the solution of a differential equation efficiently?

I'm trying to solve a set of differential equations (in parallel) and then select specific parts of the solution. What I have at the moment (see below-I've simplified the differential equations, in ...
2
votes
3answers
129 views

Accessing temporary value of a Nest evaluation

The function Nest[] must store the temporary values in the memory somewhere (those values that would form the entries of the list which is returned by the ...
5
votes
1answer
498 views

Clear and Unset doesn't free memory

Example: Try this example only if you have > 4G ram d = 2000; f[x_, y_, d_] = Sum[Subscript[a, i, j]*x^i*y^j, {i, 0, d - 1}, {j, 0, d - i}]; Then ...
8
votes
1answer
177 views

Where is my memory? — LibraryLink never returns the memory

This is an example LibaryLink code from Mathematica documentation, which takes an integer and return an integer list: ...
4
votes
2answers
339 views

Memory efficient generation and selection of tuples

The short of this question: I need to find a bunch of n-tuples of {0,1} which do not fail to satisfy a set of (non-linear polynomial) equations, without hogging up all of my memory by trying to ...
8
votes
2answers
191 views

Giving JLink Huge Memory by Default

I have noticed that Mathematica makes use of Java by way of JLink, for example, in the extensions such as DatabaseLink and (I think) RLink. It also seems like Java is a first-class citizen for writing ...
2
votes
1answer
192 views

Paging RAM in case of memory shortage issue

Is there some way in Mathematica where I can issue execution of some command with letting Mathematica use my hard disk in case it is short of RAM. It will drastically reduce the speed but I am fine ...
0
votes
0answers
111 views

How can I revise my program to avoid “No more memory available”? [duplicate]

I have a program for calculating a type of list. ...
0
votes
0answers
30 views

Keeping memory to reduce the running time of recursion [duplicate]

I am using the following recursion in Mathematica to compute W[n, 1, s] for given n and s: ...
1
vote
1answer
99 views

Memory handling by ConstantArray

I noticed the following issue when using ConstantArray: a = ConstantArray[0., {10000, 100}]; ByteCount[a] (* 8000152 *) Then ...
1
vote
1answer
152 views

Running out of memory using FindMinimum with ParametricFunctions

I am running a pretty large optimization problem which actually consists of an outer an inner optmization problem. I use ParametricNDSolve for solving a ODE system. When the optimization is done, ...
5
votes
1answer
75 views

How to relate memory usage with occupied positions of SparseArrays?

What is the relation of memory usage of a SparseArray and the number of its occupied positions? Let's say you build a 100.000.000 by 10 element SparseArray. And fill the two position 1/1 and ...
1
vote
0answers
126 views

FindRoot runs out of memory in Windows but not on Mac

I am using FindRoot to find solutions to a large, highly oscillatory equation which I generated using other code. When I run ...
2
votes
1answer
543 views

Getting MemoryAllocationFailure from NIntegrate

When numerically calculating a double integral using NIntegrate over an infinite domain (with all options at their default), Mathematica 7 calculates my integral ...
2
votes
0answers
257 views

Is mathematica storing information it shouldn't store?

I'm seeking to find solutions to a numerical integration with a large set of parameter combinations (basically, I'm doing a brute parameter sampling). Yet, I believe the memory of the computer is ...
9
votes
2answers
713 views

Why does this simple program leak memory?

I have a simple Mathematica program which writes some plots to image files for later conversion into a movie. Unfortunately, the program leaks so much memory that it quickly exhausts all 12G of RAM ...
2
votes
1answer
64 views

PolynomialRemainder memory

This calculation makes the kernel crash because it needs so much memory. Thoughts on how to get around this? ...
5
votes
1answer
154 views

Is it possible to lower the bitwidth of (floating point) numbers?

The answer to this question will most probably be a definite no. Nevertheless, I would like to know whether it is possible to represent reals in the memory on less than the standard 32 or 64 bits ...
2
votes
0answers
201 views

Project Euler (memory and speed issues)

Let n be a positive integer. An integer triple (a, b, c) is called a factorisation triple of n if: 1 ≤ a ≤ b ≤ c a·b·c = n. Define f(n) to be a + b + c for the factorisation triple (a, b, c) of n ...
7
votes
1answer
567 views

Mathematica memory management for large arrays

I have come across a weird phenomenon in Mathematica when dealing with large arrays. When generating a list with all the possible subsets of three elements of another list (thus having elements which ...
3
votes
2answers
248 views

Storing result from nested Table in a File for further computations

Consider the following: Table[Table[x = 20; y = 30; 2 i x + 3 j y , {i, 10}], {j, 3}] Suppose I want the result of this nested Table to be stored to an ...
0
votes
1answer
226 views

Why does memory run out when adding same-sized matrices in a loop?

I have written a module that it generates a 101x101x51 zero matrix at first. At every iteration, it generates a list by funct1 and based on this list, if list is empty it gives the previous result. ...
17
votes
3answers
707 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 ...
14
votes
1answer
510 views

Efficient code for tallying entries in very large lists

I am dealing with data sets containing tens of millions of (hashable) entries and simply using the Tally function to count the frequency of each unique list element ...
5
votes
1answer
242 views

Processing and storing a graph with a large number of vertices s.t. k-hop neighborhoods are efficiently retrievable

I have an unweighted, undirected graph $G$ with $(v_1, ..., v_N) \in V$ vertices, where each vertex in the lattice represents a string of some length ($\leq 200$ characters), and I need to construct ...
0
votes
0answers
79 views

Is there a way to ask Mathematica for the RAM installed? [duplicate]

Possible Duplicate: How to find out the (current) free memory on the system? Do we kwow of a function to get the installed amount of physical system memory RAM of my Windows PC?
19
votes
2answers
704 views

Why does ImageData need four times more memory?

Background We are dealing with very large TIFF image files that are imported, processed and exported using Mathematica 9.0.1. Many of our algorithms only work with an array representation of the ...
4
votes
1answer
225 views

Why does MemoryConstrained not abort when memory limit is exceeded?

I thought I had an idea that might lead to an answer to @yohbs' question, but as I was trying to check out the usage of MemoryConstrained[expr,b,failexpr], I ...
5
votes
3answers
393 views

How do I find the amount of free space on disk?

I know a workaround, where one calculates sizes of all files and then you subtract this from your default space, but is there any direct way to do it? Simplicity and speed are important. There's the ...
12
votes
2answers
1k views

How do you deal with very large datasets in Mathematica?

This question is in two related parts. The first is about dataset size, the second data wrangling. Part 1: I've built a naive Bayesian classifier on Mathematica. It uses ...
4
votes
1answer
584 views

Forget past outputs to free memory

While tinkering with a notebook that loads a large chunk of data in memory, I noticed that if I run it multiple times, the past chunks reside in memory. I understand that the reason (or one of) for ...
3
votes
1answer
176 views

How to efficiently take complement of two big lists?

I have a giant list l1 and some smaller lists l21, l21, ..., ...
7
votes
2answers
856 views

Memory running out generating ContourPlot3D

The code below ...
2
votes
1answer
696 views

NDSolve runs out of memory

I need to solve a second order ODE numerically. The ODE depends on two parameters (a,b). Things work fine when 'a' is small, but for large 'a' the solutions are oscillating rapidly and Mathematica ...
23
votes
4answers
1k views

What is the fastest way to count square-free words?

Background A word is a string of letters in an alphabet. A square-free word has no adjacent repeating substring. For example, (in the ternary alphabet of {0,1,2}) the words 00, 012121, and 0212012021 ...