Hot answers tagged

38 votes
Accepted

Smooth Peter de Jong attractor

UPDATE I thought it would be neat to try and animate the thing, so I let the $a$ parameter run between $-\pi$ and $\pi$. I generated 600 images and put them together using ffmpeg. Check it out on ...
user avatar
  • 1,491
37 votes

Smooth Peter de Jong attractor

As @RahulNarain says, forming the image point by point saves significant memory because the number of image pixels is typically much smaller than the hundreds of millions of iterations that compose it....
user avatar
  • 14.9k
34 votes
Accepted

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

The behavior described here is the same from 10.0.0 up to at least 10.3. Summary We can look at the code of DeleteDuplicatesBy and it turns out it uses ...
user avatar
30 votes
Accepted

Efficient lazy weak compositions

Chunks of weak compositions Here is slightly modified version of algorithm used in Combinatorica`NextComposition converted to a ...
user avatar
  • 14.7k
29 votes
Accepted

How do I disable the stack tracing feature in Mathematica 11?

Is there a possibility to disable stack tracing, but keep messages? Internal`$MessageMenu = False reverts back to the old messages. Seems to do the trick and ...
user avatar
  • 4,171
26 votes

Smooth Peter de Jong attractor

I revisited this problem - this time in pure Mathematica. The trick to any kind of performance is the Compile[] function, which in itself can be a bit moody - so ...
user avatar
  • 1,491
26 votes

How do I disable the stack tracing feature in Mathematica 11?

Analysis current as of Mathematica version 11.0.1 and 11.1.0. We can disable the Show Stack Trace item in the new message menu as follows: ...
user avatar
  • 67k
23 votes

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

I've always wondered about the scalability of MathLink (now officially "Wolfram Symbolic Transfer Protocol"). This is the protocol used by Mathematica to communicate between the front end and the ...
user avatar
  • 22.5k
22 votes

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

Timing charts updated for version 10.0.2. The behavior remains unchanged. Attempting to analyze the performance of this function in the manner that Taliesin Beynon did for ...
user avatar
  • 264k
22 votes

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

I decided to take one of my large packages and Remove all symbols in the Private` context that have no definitions attached to them ... And is there any risk if only those symbols that are not used ...
user avatar
  • 87k
21 votes
Accepted

Computing elements of a 1000 x 60 matrix exhausts RAM

Your function F is implemented really, really inefficiently. By quite simple means and in the proposed situation, it can be sped up by a factor of 20000. The key is ...
user avatar
19 votes
Accepted

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

Split it into 3 steps to get result immediately. ...
user avatar
  • 15.8k
18 votes

NIntegrate has a memory leak

The memory leak in NIntegrate is a bug and has been fixed as of version 10.2.0. Earlier versions would lose around 720 bytes per evaluation for this example, which ...
user avatar
  • 25.1k
18 votes
Accepted

SquaresR memory leak?

Cause Under the hood System`SquaresR is still calling functions in the context NumberTheory`. Partial output of: ...
user avatar
  • 264k
18 votes
Accepted

Generating and rendering extremely large graphs

I suggest not to use Graph to render, as it is slow. Instead, compute the vertex coordinates, then render manually. The rough steps are as follows: Create an "...
user avatar
  • 225k
17 votes
Accepted

Excessive memory use by Mathematica kernel in 10.0.2 after executing simple commands

Update: The issue has been fixed in Mathematica 10.1! :) Besides: Interesting enough, the suggestion bar's first option after evaluating the statements given above now is "solve for …", so: ...
user avatar
  • 3,675
15 votes

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

I am sure you can easily install also Linux on it and then you could contact Vladyslav Shtabovenko, the current maintainer of FeynCalc (https://github.com/vsht) and ask him about hard problems in High ...
user avatar
  • 16.8k
14 votes

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

This function will be rewritten in C for 10.0.2 and should come down to average-case complexity of $O(n)$ from its current $O(n \log(n))$. Note that the version most users will be bothered to write (...
user avatar
14 votes
Accepted

How to force Mathematica to clean up the cache

This is also not an answer (I think you found the culprit and it needs to be solved by WRI) but a suggestion for a workaround. The idea is to run the memory leaking code in an extra kernel and restart ...
user avatar
  • 23.1k
13 votes

Possible memory leak when importing JSON

tl;dr I think it's a memory leak (bug) and you should report it to Wolfram Support (please do!) According to my reading, you were saying that after importing JSON files many times, the kernel memory ...
user avatar
  • 225k
13 votes

Memory leak in the system function: how to free memory without restarting the kernel?

Please report this to support. You can get rid of some of the memory leak by executing the following: ...
user avatar
  • 124k
13 votes
Accepted

Efficient storage of large non-rectangular arrays

Special case Best way would be to not store this thing at all. It has so much structure that a[[i,j]] is cheaply computable on the fly. Integer and double ...
user avatar
12 votes
Accepted

Rendering thousands of points

Yves showed you how to shave off a factor of 10, and in the following I'll shave off another factor of 10. First, the original code (plus some data of mine to make it work): ...
user avatar
12 votes

On making a graphical real-time memory usage monitor

As a Palette 1) Using ListLinePlot: ...
user avatar
  • 27.1k
11 votes

Rendering thousands of points

One way to save memory is to use the multi-primitive syntax for Point (which should also render quite a bit faster)`: ...
user avatar
  • 14.9k
11 votes

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

I would choose a problem that exploits the unique power of Mathematica, in particular the natural functions involving graph theory, symbolic math, graphics, and the high compute power you have ...
user avatar
11 votes

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

4 TB memory? N-body of course; ...
user avatar
  • 1,146
11 votes
Accepted

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

As a more direct answer to the question of memory we can check with a test. ...
user avatar
  • 264k
10 votes
Accepted

Is there a way to control V10's undo length?

NOTE: I forgot about this. Apparently, the following should (presumably) be the way to change these settings, but the actual feature has not been implemented yet. You can change this using ...
user avatar
  • 87k
10 votes
Accepted

Table and memory efficiency

Part 1: It has to do with packed arrays. Packed arrays occupy around 1/3 to 1/4 the size of unpacked arrays, giving the results you see. You can verify this as follows: ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible