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

learn more… | top users | synonyms

9
votes
1answer
117 views

Memory leak with NDSolve

This is not the first time the question in mentionned (cf in particular this recent question NDsolve memory leak), but there seems to be a serious issue of memory leak - or am I missing something? ...
0
votes
0answers
55 views

Memory not freed after killing kernel [closed]

Even after killing the kernel the memory was not back. I run more than 40 computation session on 14 core in a PC with 12GB ram. after about a month just one of my codes remain running with using about ...
1
vote
1answer
46 views

Control data type (or precison?) to limit memory usage

I couldn't find the answer to my question, so here it is: I have quite a large table, which I generate in Matlab (for some reasons i use both Matlab and Mathematica, I'd like to use only one of them, ...
0
votes
0answers
36 views

Memory leak with Out[] [duplicate]

My understanding is that during evaluations in front end all the Out[]-s are in the memory, so they accumulate and at some point might cause Mathematica to crash. ...
5
votes
1answer
198 views

Is there an alternate way to calculate beyond the memory limit of the home edition?

I bought the Home Edition of Mathematica online 0.5 G of memory and costs \$150 per year. When I calculated the median of outputs from $[0,1]$ with an interval of $.000001$ I ended up with the ...
1
vote
0answers
39 views

Why is Mathematica causing Window's “System and compressed memory” to stay high even after clearing everything?

I am doing some calculations that take up a lot of RAM. Sometimes, I do a short run, and then it either finishes naturally or I abort evaluation. However, it seems like the RAM is still set aside for ...
3
votes
0answers
68 views

NDsolve memory leak

Every time I run NDsolve it uses some memory that I am not able to free later. The following is an example code based on the spring equation (Hooke's law) that ...
1
vote
0answers
48 views

“Not enough memory” error even though plenty of memory still available

Summary: The evaluation of an Export[...] expression fails with a "Not enough memory available" error, but the value returned by ...
14
votes
2answers
628 views

Is there any harm or benefit to Removing unneeded private symbols in packages?

One of the things I noticed is that in typical medium-to-large sized packages, a huge number of symbols are created in the myPackage`Private context. You can see a ...
6
votes
0answers
50 views

EventLocator in NDSolve seemingly hogs memory in Windows, but not Mac

I have written a function (ftest in my code) which does the following: Takes a vector {x,vx,vy} as input Numerically solves (with high precision) a specific ...
2
votes
2answers
578 views

How to Flatten and stack Efficiently 50000 Images

I have 50000 grayscale images with 56*56 pixels each one. I need to flatten images and stakck it in the same array with dimensions 50000*3136 after that export the file as .CSV. I am doing this code ...
3
votes
2answers
137 views

Summing matrix products

I need to compute a double sum over a weighted matrix product: $L[M]=\sum_{i,j}^{N}\Lambda[[i]]\;\omega[[i]].M.\omega^{\dagger}[[j]]$. $\Lambda$ is a list of with N complex values(weights) and $\...
0
votes
0answers
25 views

Run a nb from another nb in a different kernel then quit the kernel [duplicate]

I am trying to save some memory space because the calculation I am doing is quite expensive in space. Here is the case : I have two nb : main.nb and run.nb I want to launch run.nb from main.nb in a ...
7
votes
1answer
92 views

A few tuples at a time?

I want to generate $n$ by $n$ binary arrays, and then reduce the output from those arrays by performing a number of permutations and eliminating duplicates. The problem is that the number of arrays ...
2
votes
0answers
71 views

NDSolve produces zombies

I am using Mathematica 10.1 and when I execute NDSolve then there are temporary variables produced every time I call it. This seems not to happen when I explicitly ...
7
votes
1answer
155 views

MovingAverage - not enough memory exception

I'm running into an extremely bizarre issue that evades reproduction by means other, than repeating my actions verbatim. Please note, this question is NOT about digitizing a plot. It just describes ...
1
vote
0answers
81 views

Possible memory leak in FindMinimum? (MMA v10.0)

So I was running some code when I noticed Mathematica was gulping memory, and after some debugging I think the culprit is found. It turned out the function ...
2
votes
2answers
262 views

Follow each pixel brightness in set of images (Memory constrained)

I have a set of 2700 consecutive png images (8bit, 2048*2048 pixels). I would like to visualize the intensity variation of each pixel vs. image number. Here is an example of 10 images: http://goo.gl/...
1
vote
1answer
184 views

NDSolve memory usage [closed]

I am trying to solve numerically a system of linear ODEs with some quickly varying driving functions. The basic command is: ...
0
votes
0answers
60 views

frequent slow evaluations for trivial expressions, large memory loaded

After loading a lot of data into memory and evaluating several hundred expressions without any problems, trivial expressions such as (1+2) take about 5-10 seconds to evaluate. Sometimes they are fast,...
39
votes
9answers
2k views

What would you ask Mathematica to do on a big system?

Our hardware supplier has given us the opportunity to test Mathematica on a big Windows system. The specs will be 1 to 4 TB of working memory and 12 sockets with 18 cores each. I got 1 full week of ...
4
votes
2answers
109 views

`IntegerPartitions` without duplicates

I need to apply a function to integer partitions of many integers, but only the partitions without duplicate numbers. Select[IntegerPartitions[n], DuplicateFreeQ] ...
0
votes
0answers
39 views

Why does NDSolve and ParametricNDSolveValue show different memory manage in same loop?

This is a follow-up question about How to delete InterpolationFunction created by NDSolve/ParametricNDSolve?. In the previous question, J. M.♦ and Albert Retey showed $HistoryLength = 0 and Clear[] ...
0
votes
0answers
58 views

ButterworthFilterModel consumes the memory too much

I have a simple filter which is a result of the these questions here and here I have to use this filter in a Do loop but I found that this filter consume the ...
1
vote
0answers
74 views

How to delete InterpolationFunction created by NDSolve/ParametricNDSolve?

I have faced a uncommon problem. The situation is that I need use ParametricNDSolve/ParametricNDSolveValue to solve ODEs system in the non-linear model fitting process. So every iteration generating a ...
1
vote
0answers
79 views

Lower memory usage and speed nested loops

I'm trying to make some tracking with Mathematica. ...
1
vote
0answers
54 views

Running out of memory when doing non-commutative arithmetic

I need to calculate particular coefficients of the composition of two power series in non-commutative variables. The code below which works fine truncates power series in degree $n=5$. For $n=6$ (the ...
14
votes
3answers
274 views

On making a graphical real-time memory usage monitor

I'd like to make a graphical version of Dynamic[Refresh[MemoryInUse[], UpdateInterval -> 1]] A naive implementation would be something like: ...
1
vote
1answer
160 views

Simplify the huge determinant product

I try to get the following determinant product result, ...
24
votes
1answer
708 views

Efficient lazy weak compositions

In Mathematica all weak k-compositions of integer n can be generated using permutations of integer partitions: ...
10
votes
1answer
96 views

How to speed up the evaluation of a function with a large LeafCount but many repeated sub-functions for use in NIntegrate

General Context Apparently, the memory leak in NIntegrate is unavoidable pre-MMA-10.2. I have some (two-dimensional) numerical integration to do on a complicated ...
11
votes
0answers
199 views

Memory usage of compiled function: C vs WVM

Reported to WRI [CASE:3406803] Why does generating an array in "C"-compiled function uses 50% more memory than doing same thing in ...
11
votes
1answer
453 views

Nintegrate has memory leak

Bug introduced in 6.0 and fixed in 10.2.0 NIntegrates uses memory and does not release it. For long loops with NIntegrate ...
0
votes
1answer
96 views

NIntegrate and memory use [duplicate]

I wonder why NIntegrate uses memory. I have a long integral computation repeated thousands times. The memory use then goes up and speed goes down. I think I spot a ...
2
votes
0answers
84 views

Is there a way to specify which kernel is used to import files (SOLVED)?

Following up on a previous question in which I encountered a memory leak in the JSON importer I have created a SandBox script that will run the Import and analysis on a separate kernel, which be ...
6
votes
1answer
123 views

Is there a way to monitor the memory used by mathematica as a dynamic expression?

I always use the terminal's htop for this, but wouldn't it be nice to visualize per kernel the memory used in a dynamic expression?
6
votes
2answers
142 views

Possible memory leak when importing JSON

Bug introduced in 10.0 and persisting though 10.2.0 This problem that I would like to resolve is how to free memory used Import a file when the file is no longer in use. I have a project in which ...
3
votes
0answers
94 views

Memory Management for Large Datasets [closed]

I've written some Mathematica code to generate polynomial roots. The code take an argument n as the highest degree of polynomial to solve for and then exports a file containing a list of the roots: <...
1
vote
0answers
40 views

Imported variables (.mx) are emptied occassionally (Linux, v10.0.2)

I have a severe problem with variables being "emptied" occassionally. I am not able to reproduce the behavior but this is basically what happens: 1) store list list...
3
votes
1answer
111 views

Simplify a huge expression with limited memory

I would like to perform some analytical sums such as the following ...
5
votes
1answer
149 views

memory leaks using NIntegrate on parallel kernel

Bug fixed in version 10.2.0 I'm running a large computation in parallel and the memory usage of the parallel kernels is increasing with every iteration of the calculation. Neither ...
5
votes
3answers
286 views

Huge matrices crashes in Mathematica

I have a matrix of data ~(70,000x70,000). I am searching connection between these data points. I use euclidean distance for that purpose. If it is less than my threshold (that means they have ...
3
votes
2answers
106 views

Add Results of ParallelMap in Parallel

I'm new to coding in parallel, but I really could use it. I need a command to call a function on each element in a huge list, and then add them all up. Currently I use something like this: ...
2
votes
0answers
82 views

MatrixRank of a large but sparse matrix

I want to find the rank of a very sparse, quite rectangular matrix mat, but I'm running out of RAM (I have 16 GB) if I try to use ...
0
votes
0answers
61 views

Is it possible to change default $HistoryLength [duplicate]

By default $HistoryLength is set to \[Infinity]. This is often unnecessary and can cause unecessary memory usage. I can of ...
1
vote
0answers
63 views

Does Sum calculate all terms before summing them?

After calculating the sum of a large number of large objects, using B = Sum[RandomInteger[{0, 1}, {10^6}], {100}]; I find that ...
2
votes
2answers
76 views

Notebook cells space on disk profiler

I have one single notebook with more than 500 mb... To control its growth, I would like to have a profiler of used space (not the live memory, but the space on disk), in such a way that I can easily ...
7
votes
1answer
289 views

NMinimize with NIntegrate (crash in symbolic evaluation, memory leak)

This is a "common" problem from what I've seen, but with a different spin. I have a function I use often that finds a fit of an expression to another expression with some free parameters (e.g. for ...
2
votes
0answers
81 views

Pros/Cons to updating in place

There are often times when I have to update a list. The following is an example: ...
2
votes
1answer
186 views

Memory usage optimization for a large Association/SparseArray

Reformulating my question in simpler terms. Take two lists list1 = RandomInteger[{1, 100000000}, 25000000]; list2 = RandomReal[{1, 10}, 25000000]; Make an ...