Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6188835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:18:17+00:00 2026-05-24T02:18:17+00:00

This question is inspired by the question on memory leaks in Mathematica due to

  • 0

This question is inspired by the question on memory leaks in Mathematica due to internal caching of results of intermediate computations. All these things are undocumented but are important for anyone who runs memory-intensive computations.

When trying to understand the logic of the internal caching mechanism I found something interesting. Consider the following:

$HistoryLength = 0;
(*dummy command for loading of the Root package*)
Root[# &, 1];
d = 13;
f[z_, i_] := Sum[(2 Mod[Floor[(i - 1)/2^k], 2] - 1) z^(d - k), {k, 0, d}];
(memLog = Flatten[
     Table[Root[f[z, i], j]; {SessionTime[], MemoryInUse[]/1024.^2}, {j, 1, 
       d}, {i, 1, 2^d}], 1];) // Timing
pl1 = ListLinePlot[memLog, 
  FrameLabel -> {"SessionTime, sec", "MemoryInUse, Mb"}, PlotRange -> All, 
  Frame -> True, Axes -> False]
pl2 = ListLinePlot[memLog[[All, 2]], 
  FrameLabel -> {"Point", "MemoryInUse, Mb"}, PlotRange -> All, Frame -> True,
   Axes -> False]

In fresh kernel session the output on my machine (Mathematica 7.0.1 for Windows) is always as follows:

screenshot

Can anyone explain why there is a break of the curve near the point number 8400?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:18:18+00:00Added an answer on May 24, 2026 at 2:18 am

    The point at which the change in slope occurs is no. 8192. This equals 2^13, which is the upper bound of the fastest of your Table indices, i. When mma arrives at this point it has calculated all possible f[z, i] values. Since this call is independent of j, the next value of j (2) will generate the same range (f[z, 1], ..., f[z, 8192]) again. I assume this is where internal caching kicks in and fewer additional memory is needed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Inspired by this question I began wondering why the following examples are all illegal
Inspired by the discussion in this question . We have all been taught that
This question is inspired by this post: reason for memory leakage in C C++
This question was inspired by a similar question: How does delete[] know the size
This question is inspired by Does Linux provide a monotonically increasing clock to applications
This question is inspired by Jon Skeet's answer: Is there a c# equivalent to
This question is inspired by the article Why are Facebook, Digg, and Twitter so
Inspired by this question , I wanted to try my hand at the latest
Inspired by this question and answer , how do I create a generic permutations
My question is partially inspired by this article written by Eric Lippert: http://blogs.msdn.com/ericlippert/archive/2009/10/19/what-is-this-thing-you-call-thread-safe.aspx Using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.