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

>100 GB of memory used by Reduce. Am I doing something wrong?

Newish to Mathematica here. I'm running some code to compute regions of the parameter space where the covariance between innovations is positive or negative. On my Windows PC, it's been running for ...
hipHopMetropolisHastings's user avatar
2 votes
0 answers
71 views

Memory leak with pure function and in the listable option of compiled function?

I'm using 13.0.0 for Microsoft Windows (64-bit) (December 3, 2021) When I repeatedly run the command ...
dzsoga's user avatar
  • 341
0 votes
0 answers
40 views

How to download and keep a dictionary? [duplicate]

I use a Dictionary and download it by the command (example Swedish): dict1 = DictionaryLookup[{"Swedish", Repeated[{alfabetet}, {1, Infinity}]}] It downloads and all is well. But when I ...
JSP's user avatar
  • 367
5 votes
1 answer
419 views

Is this buggy behavoir of Module solved? [closed]

I have just found out about this bug of Module, i.e. the creation of "zombie"-variables in some cases (see also this post). I couldn't find a post saying ...
mattiav27's user avatar
  • 6,525
3 votes
1 answer
147 views

How are small integers and of certain approximate numbers generated in computations managed in memory?

In the documentation tutorial/SomeNotesOnInternalImplementation, it says: Most raw objects such as strings and numbers are allocated separately; however, unique ...
rnotlnglgq's user avatar
  • 3,680
3 votes
0 answers
22 views

Global time constraint or sandboxing across a notebook?

This may be off-topic, but when accidentally running a process which turns out to be computationally more intensive than expected (or even getting stuck in an infinite loop), it seems that there is ...
user366202's user avatar
5 votes
1 answer
118 views

How could I see the memory use on sparse array and constant array matrices? What is the advantage? [duplicate]

I have a huge matrix defined using constant array function and it allocates so much memory preventing the calculation. Therefore, I would like to change the constant array matrix into sparse matrix ...
Kazim Ahmet Hasim's user avatar
3 votes
1 answer
163 views

Efficient memory usage while building a large sparse matrix

I am sure the following problem has been solved already, but I am unable to find any solution... Any help appreciated! So I am building a pretty huge matrix (or tensor, actually) using ...
Philipp's user avatar
  • 115
4 votes
1 answer
144 views

Why does `MemoryInUse` keep increasing?

Consider MemoryInUse. After kernel initiation, I have noticed that its value keeps increasing, even when not evaluating any cell, as seen ...
sam wolfe's user avatar
  • 4,187
14 votes
1 answer
442 views

Memory leak with Mathematica Graph functions

I am running Mathematica 13.2 on a Mac OS Monterey. I have a large code that manipulates graphs both in graph form and as adjacency matrices, computes some graph properties, and returns a list. It has ...
Kassa's user avatar
  • 143
0 votes
0 answers
46 views

MMa 13, holding previous solutions instead of clearing them

I suspect this is something one line of code will fix, but I have a fairly simple code, that needs to be evaluated at 2 different points. I tried it for the first one... got an answer, it's correct, ...
Epideme's user avatar
  • 505
1 vote
1 answer
40 views

How to refer to calling notebook instead of my personal include? / detector for high-memory-usage cells

Along the lines of a couple previous posts, I coded this function to show you where in your notebook your biggest space-wasters are. Useful for when your file is becoming huge and unmanageable for ...
Trev's user avatar
  • 753
2 votes
0 answers
86 views

Restart kernel after each evaluation in Table

I am trying to integrate a two-dimensional function purely numerically. For one coordinate the integrand can oscillate rapidly while for the other coordinate the integrand is not behaving in a special ...
Phenoxim's user avatar
1 vote
0 answers
37 views

Sorting stored variables in memory

Given the list of stored variables Names@"`*" is it possible to sort them by size in used memory?
sam wolfe's user avatar
  • 4,187
2 votes
0 answers
101 views

How to access Shared Memory in Mathematica

I'm running Python code to receive live data stream through web-socket and storing it in the shared memory as the following; ...
csk 7's user avatar
  • 403
2 votes
0 answers
54 views

MemoryConstrained[] does not work as expected

I am trying to put an upper limit on how much memory the kernel can use. For this, I am using the MemoryConstrained function in Mathematica. But this behaves very weirdly as shown below. ...
jar-'s user avatar
  • 55
0 votes
0 answers
38 views

What is the best memory utilization and efficiency considerations for simulating particles that are randomly created and removed?

I am wanting to run a simulation involving a varying number of "particles" (points defined by 2D coordinates $(x,y)$ within some region). At each time step, there is a probability that a new ...
BioPhysicist's user avatar
2 votes
0 answers
64 views

Controlling memory consumption by memoized function

To speed up a resource-intensive calculation, I use several functions with storing previously calculated values. For example: ...
Igor Kotelnikov's user avatar
1 vote
0 answers
108 views

How can I prevent Mathematica from filling up memory and crashing my PC when I execute a faulty instruction? [closed]

Sometimes I make a silly mistake and run code that keeps on filling up the memory. Once that is filled, my OS starts page swapping, and there's pretty much nothing I can do except reboot the PC. An ...
Klangen's user avatar
  • 967
2 votes
0 answers
61 views

Parallel image comparison function keeps increasing memory

I have written the following code to align two arbitrary images: ...
Thanatomanic's user avatar
23 votes
2 answers
2k views

What happens if you don't Reap what you've Sown?

As I understand it, when using Sow[expr] you throw the expr on some private stack which you can ...
Gert's user avatar
  • 1,460
2 votes
1 answer
184 views

TextRecognize has a memory leak?

This code causes Mathematica to slowly accumulate memory until it hard crashes my operating system. It does this by overwriting OS memory (windows start going black, graphics drivers start crashing ...
John's user avatar
  • 2,409
3 votes
2 answers
120 views

Improve speed and memory use in the construction of linear combinations of two lists

I have two lists, list1 and list2, for instance ...
az123p's user avatar
  • 239
0 votes
1 answer
73 views

Table size/dimension error

I'm trying to create a table of the form ...
user2574698's user avatar
6 votes
1 answer
103 views

Does converting large 3D matrices to VERY large 2D matrices affect speed of operations done on the matix?

Novice question! Does the dimensionality of a matrix affect the speed of operations performed on it (or the speed of retrieval of values from it) IF the total number of elements in the matrices are ...
Ssdmitten's user avatar
  • 185
18 votes
2 answers
496 views

Garbage collection for lexical closures

Mathematica is known not to garbage collect temporary variables in certain cases. I am particularly interested in the very useful programming pattern known as a lexical closure. A somewhat trivial ...
user293787's user avatar
  • 11.7k
1 vote
0 answers
61 views

Leverage swap space on Linux

Maybe this would be better suited on a different stackexchange, but I'll ask it here anyways in case Mathematica has some inbuilt functionality I'm not aware of. I'm running ...
shanedrum's user avatar
  • 557
7 votes
1 answer
249 views

How to remember evaluation across sessions?

I am performing a very time-consuming symbolic calculation. When I reopen a saved Mathematica notebook, it takes quite a long time to evaluate. Is there an option to tell Mathematica to remember the ...
Yrefef's user avatar
  • 71
1 vote
0 answers
94 views

Why Mathematica don't set \$RecursionLimit and \$IterationLimit very big by default? [closed]

For my current program in Mathematica, sometimes I will encounter an error regarding \$IterationLimit and \$RecursionLimit. So I always set these two numbers to very large at the starting of every ...
Canonical's user avatar
9 votes
1 answer
275 views

Working around Memory Leak from HermiteDecomposition

I am running into an issue where HermiteDecomposition seems to leak memory, but only from certain matrices ...
fireflame241's user avatar
0 votes
1 answer
80 views

Memory problems when fitting large (correlated) datasets

I am trying to fit some complicated function that depends on 18 parameters. The problematic is that I have a large correlated dataset (336 points). When fitting, for simplicity, taking only the ...
pablo's user avatar
  • 711
4 votes
0 answers
95 views

JoinAcross Memory Leak

I believe JoinAcross may have a memory leak but would appreciate some help looking at it. It appears to be small when used just once but when iterated a lot it eventually crashes my wolframscripts. I'...
rfrasier's user avatar
  • 592
3 votes
1 answer
137 views

How to optimize ContourPlot3D evaluation?

I tried to plot a certain 3D sine function: ContourPlot3D[(Sin[x^2] + 2) * (Sin[y^2] + 2) * (Sin[z^2] + 2) , {x, -2, 2}, {y, -2, 2}, {z, -2, 2}] but ran into an ...
Allam A.'s user avatar
  • 333
3 votes
0 answers
90 views

Free up used Memory

When using FunctionCompile[] to generate a large matrix of ranges there seems to be no way of recovering memory even though the variables are either out of scope or overwritten. I am aware that there ...
user8281's user avatar
  • 151
0 votes
0 answers
109 views

See variable as byte

I see variable v is occupying 112 bytes of my RAM. v = {3, 5, 7}; ByteCount[v] 112 Then how to see the content of the 112 bytes?...
imida k's user avatar
  • 4,037
1 vote
0 answers
57 views

Erratic behavior retrieving large data (several tens of gigabytes) that has been serialized by Mathematica

Hardware: PC with 256GB RAM OS: Windows 10 Mathematica: Version 13.0.1 One of my projects has led to the creation of a SparseArray whose ByteCount is ~ 35GB in RAM. At the time of creation the ...
Todd Allen's user avatar
  • 2,104
6 votes
1 answer
175 views

Unexpected high memory consumption using out-of-core NetTrain

I'm working on training a neural network on an image dataset. There are 14k images and each image contains 3x150x150 pixels. I have built a generator function following the approach in Training on ...
Charmbracelet's user avatar
4 votes
1 answer
258 views

Memory use buildup when solving PDE multiple times

Bug introduced in 13.0 or earlier and fixed in 13.1.0 Mathematica V 13.0 Mac OS X ARM (64-bit) - MacBook Pro 13" M1 processor macOS Big Sur 11.6.2 I am solving a PDE numerically and have noticed ...
user404736's user avatar
0 votes
2 answers
108 views

Memory preserving computation in chunks

I would like to do the following: Make a table tab1={{i1,b1,c1,d1},{i1,b1,c1,d2},...,{i1,b1,c2,d1},...,{i1,b2,c1,d1},...{i2,b1,c1,d1},...} for the given range imin < i < imax. Make some ...
John Taylor's user avatar
  • 4,984
9 votes
3 answers
892 views

How to clear up RAM without exiting kernel?

I am trying to implement the code which generates some table, works with it, extracts some numbers, add them to some other table, then clears the table (only the table and not the other elements of ...
John Taylor's user avatar
  • 4,984
11 votes
2 answers
668 views

Out of memory when computing a coefficient of a large symmetric polynomial

...
PalmTopTigerMO's user avatar
3 votes
0 answers
271 views

How to allocate more physical memory to Mathematica?

My MacBook Pro (2019) has 32 GB of memory, but when I work with a large array reaching 1 GB of storage, the Mathematica Kernel only gets a little more of 1 GB, but gets allocated a lot of virtual ...
hippo3773's user avatar
  • 1,216
2 votes
0 answers
104 views

How to avoid running out of memory in ParallelMap?

I am mapping a function over a list of length 77237. ParallelMap[AnalyzeZernikeRecord,records] The result of each function application is just a list of 12 numbers....
abwatson's user avatar
  • 1,889
0 votes
0 answers
36 views

How can I prevent functions and variables from being automatically cleared when I close Mathematica? [duplicate]

The following happens with every notebook I make: I define functions and variables. When I quit Mathematica and reopen the notebook, all of those definitions have been cleared. The functions and ...
nmehndir's user avatar
2 votes
1 answer
65 views

What circumstances would cause memory to inflate while packing the sublists of a ragged matrix?

I'm working with a ragged matrix of considerable size (ByteCount = 47749114088; Length = 563529128). I had seen a suggestion mentioned in other questions (here on StackExchange), that one might be ...
Todd Allen's user avatar
  • 2,104
2 votes
2 answers
116 views

Finding IntegerPartitions[252] with no zero and no duplicates

Well, I am trying to execute the following code: ...
Jan Eerland's user avatar
  • 1,941
5 votes
0 answers
65 views

Memory leak in FindMinValue?

I was running some geometric optimisation code today using FindMinValue and for some reason at one point the memory usage goes upwards of 14GB, making the kernel ...
Liam Baker's user avatar
0 votes
0 answers
70 views

Encountered SystemException["MemoryAllocationFailure"] while trying to plot a function

I have an expression that simplifies to the following expression, which I denote as a function X. ...
madmiKe's user avatar
2 votes
1 answer
128 views

How does Leafcount work? [closed]

I am curious about how LeafCount works because when I count the number of leaves in my solution to a Wolfram Challenge, I get a much smaller result than those listed on the leaderboard for Multiples ...
Peter Burbery's user avatar
1 vote
0 answers
93 views

How to optimize Code for Wolfram Challenges? [closed]

I am wondering if anyone who has knowledge of optimizing programs in the Wolfram language has any advice on how to optimize the following quantities of programs written to solve Wolfram Challenges. I ...
Peter Burbery's user avatar

1
2 3 4 5
9