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

learn more… | top users | synonyms

5
votes
1answer
209 views

Optimizing Monte Carlo simulation of a Pred-Prey model

My assignment and code As part of an assignment for one of my classes, I'm trying to run a "massive" Monte Carlo simulation in Parallel on the follow model: ...
13
votes
1answer
260 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 ...
3
votes
1answer
96 views

May I restrict caching to disk when memory runs low? [duplicate]

An hour ago, I had to hard reset my laptop again because Mathematica froze the system again. When import a large file or make a mistake that produces huge arrays with complicated entries etc., I often ...
1
vote
1answer
91 views
8
votes
2answers
226 views

How to un-eat memory?

Consider this code: ...
4
votes
3answers
202 views

Is there something wrong with this piece of code involving Manipulate?

I am playing around with the Manipulate sentence. I think the following code is right, and actually Mathematica 9.0 doesn't return any error message, but I am ...
0
votes
0answers
74 views

Memory problem in Mathematica 10

I'm having a problem with memory. I'm doing nonliner fits of several data lists to a system of differential equations. When I evaluate the "Do" cycle the memory grows with the iteration step up to my ...
0
votes
1answer
45 views

Restarting Mathematica causes an animation to fail to run [duplicate]

I've tried animating two different sets of 3D plots. Interestingly, one plot will always work, regardless of whether I restart Mathematica, yet another plot will only work in its current Mathematica ...
3
votes
1answer
54 views

Manipulate inside a function definition slows down when passed a large data set

I'm working with large data sets (>1gb) which I'm visualizing with Manipulate[]. The following example works fine for me with no additional memory overhead: ...
19
votes
3answers
606 views

DeleteDuplicatesBy is not performing as I'd hoped. Am I missing something?

Déjà vu: a new-in-v10 function should provide a better solution to an old problem, but my enthusiasm is curbed when I run timings. This time the function is ...
3
votes
0answers
89 views

Using cursors with result sets to reduce memory usage

I have a database table with 900,000 rows and 80 columns per row which I'd like to work with in mathematica. My computations are isolated to each row, so I'd like to stream only a single row (or small ...
4
votes
0answers
50 views

Possible JLink memory leak (during) object creation

Using MMA 9.0.1 on win7-64. When creating a large number of java objects I noticed memory being consumed in huge quantities (several Gb). This memory is returned/deallocated after my call ...
0
votes
0answers
53 views

Using less memory to store and manipulate specific types

Is there a simple way to use Integer types (in particular, a table of Integer types) that require only 4 or 8 bytes (reps. 32 and 64 bits) representation? It seems that integers in Mathematica have a ...
23
votes
3answers
669 views

Smooth Peter de Jong attractor

Today I was playing with Peter de Jong attractor. At the bottom of the page I've linked there are beautiful examples like: My attempts are not so great: It is around 10^5 points. For more than ...
20
votes
4answers
2k views

Plotting large datasets

I have a lot of data (e.g., 64x8192), to plot and it consumes too much memory (more than 2 GB) causing Mathematica to return "no memory available". For example, ...
5
votes
1answer
181 views

Higher RAM handling by 32bit Mathematica [closed]

Can 32 bit Mathematica run program which requires more than 4GB RAM ?
2
votes
1answer
218 views

Parallel evaluation and memory use

I have never used Mathematica's parallel evaluation before and have some trouble getting it to work properly. For the record, I am running Mathematica 9 on Linux with an Intel Core i7 processor (4 ...
1
vote
2answers
92 views

Clearing arguments passed to a Module

Is there a possible way to clear the arguments passed to a module to release some memory. I believe that arguments passed to modules are passed by value rather than pass by reference. e.g. I have the ...
3
votes
0answers
122 views

Module in numerical model for NonlinearModelFit is slow and leaks memory

I am trying to make a NonlinearModelFit where the model is the result of a numerical calculation. My code works, but it is very slow and also seems to have a memory ...
7
votes
2answers
177 views

How can I tell how much memory is taken by an expression?

ByteCount and LeafCount don't really work, as shown below. Mathematica 9.0 .. on a 32 bit Windows machine. ...
3
votes
1answer
170 views

Writing results directly to file

I am trying to find all simple paths in a large directed graph (542 vertex, density ~ 5%) between two nodes. For this purpose, I use the algorithm from this thread. Unfortunately, my computer is ...
7
votes
3answers
477 views

How to fix this memory leak

I am using halirutan's code in this thread to unflatten a list. It works very well but the problem is that the Module's local function f is not deleted when the ...
1
vote
1answer
58 views

Write memory usage to file in script

Is there a way to write the MemoryInUse into a file once a minute? In this Debugging memory leaks question there is a neat dynamic diagram showing the MemoryInUse over time. My problem is that I run ...
3
votes
1answer
52 views

OpenCLLink eating up all host memory

I am calling lots of OpenCL functions from Mathematica. The problem is that the memory the kernel uses grows and grows until the RAM is fully occupied. I have created a small piece of code to ...
2
votes
1answer
44 views

Why does MemoryConstrained have an upper limit on the constraint?

When evaluating MemoryConstrained for a large memory limit: MemoryConstrained[Print["aaa"],10^10] I get: ...
0
votes
0answers
121 views

Memory issue when using LinearSolve

When I use LinearSolve to solve a large system of linear equations where the left hand side is a matrix and the right hand side is a vector, the process takes a ...
6
votes
1answer
120 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 ...
0
votes
0answers
17 views

Restoring a Mathematica session without notebook interface [duplicate]

It happens all the time that I close my Mathematica session and later I regret that I have done so, because there are many things that I would like to check. I would like to know if there is a way to ...
2
votes
0answers
74 views

Problem with files size

I need to work with long time series, but I notice that this generates huge files that Mathematica doesn't handle well at all: even opening/saving one of this files is difficult, and the kernel quits ...
2
votes
2answers
81 views

Random Choice: List Format & Minimizing Memory Use

This is a two part question, and for that I apologize.. but they're related! Here's what I'm working with: ...
1
vote
0answers
74 views

Memory consumed by NMaximize with NDSolve

I'm using NMaximize on a function that calls NDSolve, and running out of memory. I created the following minimal example that (I ...
8
votes
1answer
140 views

AndersonDarlingTest and DistributionFitTest Leaking Memory

I believe AndersonDarlingTest and probably all other tests are keeping a copy of data somewhere and not freeing it: ...
18
votes
4answers
399 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 ...
5
votes
1answer
131 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 ...
9
votes
2answers
492 views

Memory leak issues

I am working with noncommuting objects and basically I am using Mathematica to sort large expressions by normal ordering and simplifying them. To this end, I first create an object called ...
4
votes
2answers
126 views

Can one use Map during Expand?

Can one Map a simplifying function to the summands of an Expand before fully expanding the expression in question first? ...
0
votes
0answers
97 views

Heavy duty operations, RAM, and Readyboost

I occasionally work with large 3D arrays and found that with calculations that take a long time, Mathematica completely fills my available RAM (6056 MB minus other active operations [mostly svchost]), ...
10
votes
3answers
230 views

Can I return lists with different dimensions from a compiled function?

Sometimes I'll need several lists with different dimensions to be returned by a compiled function, but compiled function will fail if an irregular list contained: ...
6
votes
2answers
309 views

Memory management and speed for Fast GCD

Let's say that we have some $300\,\text{K}$ digits (arbitrary function) and want to trial factor with $100{,}000{,}000$ first prime numbers. ...
14
votes
1answer
293 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 ...
2
votes
0answers
56 views

How to save all variables in the workspace into a file? [duplicate]

I did some time consuming computation and obtained a lot of arrays and variables; however after restart the Mathematica Kernel, all these computational results disappeared. How can I save all these ...
19
votes
3answers
1k views

Does parallel programming use up large quantities of memory in Mathematica?

When I start Mathematica with a fresh kernel and load a program I am developing to analyze biology data, the amount of used system memory is 1.9 GB (free memory is 14.5 GB). These memory values are ...
5
votes
2answers
151 views

Remove versus ClearAll

What is the difference between Remove and ClearAll? I thought that "not being recognized by Mathematica", which is the effect ...
15
votes
2answers
231 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 ...
9
votes
2answers
641 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 ...
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
72 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
95 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. ...