I'm using the online version in the Wolfram Cloud. Whenever I attempt the following computation:

  Sin[x] + Sin[y] + Sin[z],
  {x, 0, 4}, {y, -2, 2}, {z, -2, 2}

either the kernel will crash (barely noticeable except that the In/Out markers on the left change to gray dots as if I were returning from a sufficiently long period of inactivity) or the whole page on which I'm working will go to an error screen stating that there is not enough memory to display the page.

In the latter case, attempting to re-enter the notebook in question will cause the memory usage by the browser to soar to nearly 3 gigabytes once it tries to load the plot of the formula above, followed by an "Aw, snap!" screen (I'm using Chrome). One of my 3D plotting notebooks is bricked because of this.

Normally, if a computation requires more memory than the user's Cloud plan will allow, an error message will appear stating "This computation has exceeded the memory limit for your plan". This did not occur here.

Some plots I have previously generated with polynomial functions appeared comparably intensive to render to what I would expect for a sine function, but none caused problems like this. Is the plot just too heavy to render, or is there another issue? Can it be optimized not to require as much memory?

  • 1
    $\begingroup$ It takes about 7 seconds on my free cloud account. result $\endgroup$
    – Syed
    Mar 10, 2022 at 21:15
  • $\begingroup$ Cool that you managed to get it! Did my kernel crash because I already had a few plots in the notebook? I wonder if it is possible to optimize the function so that I can explore more without using too much memory. $\endgroup$
    – Allam A.
    Mar 10, 2022 at 21:21
  • 2
    $\begingroup$ For reference, in Mathematica 12.1 on my Linux machine this takes about 50MB to store the plot result (checking by comparing MemoryInUse before and after), and only 320MB to generate it (checking MaxMemoryUsed on the expression). $\endgroup$
    – eyorble
    Mar 10, 2022 at 22:25
  • 1
    $\begingroup$ On windows 10 in MMA 13.0: a = MemoryInUse[]; ContourPlot3D[ Sin[x] + Sin[y] + Sin[z], {x, 0, 4}, {y, -2, 2}, {z, -2, 2}]; b = MemoryInUse[]; b - a It takes only 13 MB. $\endgroup$ Mar 11, 2022 at 13:29
  • 1
    $\begingroup$ @MariuszIwaniuk It takes 25 MB on the first run in a fresh kernel, and 13 MB on the second run. MMa 13.0.1 on Win 10 x64. $\endgroup$ Mar 11, 2022 at 17:10


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.