Re: Memory requirements in Mathematica 6

• To: mathgroup at smc.vnet.net
• Subject: [mg83039] Re: Memory requirements in Mathematica 6
• From: "Michael Weyrauch" <michael.weyrauch at gmx.de>
• Date: Thu, 8 Nov 2007 06:11:49 -0500 (EST)
• References: <fgs8h1\$48d\$1@smc.vnet.net>

```Hello,

Well, I thought that you want me to publish the code... I do it with some hesitation, since
I think it's very bad code. It can be done much more effciently...

But that's not the issue here, the issue is
why this code (bad as it may be) did run under Mathematica 3 under Unix with 4G, but rocks the (memory) roof of our 64 bit Linux Box
with 32G (latest SUSE operating system) after some 20 to 30 minutes of running under Mathematica 6.
And then even crashing the machine, not just quitting the Mathematica kernel!

Here comes the essential piece of the code, which I just cleaned a bit for brevity:

W[o_] := (norm = {k1, k2, k3, k4, k5, k6, k7, k8}; n = Length[norm];
G = {(3*k1)/4 + k2/4 - k3/4 + k4/4 - k5/4 + k6/4 - k7/4 + k8/4,
k1/4 + (3*k2)/4 + k3/4 - k4/4 +
k5/4 - k6/4 + k7/4 - k8/4, -(k1/4) + k2/4 + (3*k3)/4 + k4/4 -
k5/4 + k6/4 - k7/4 + k8/4,

k1/4 - k2/4 + k3/4 + (3*k4)/4 + k5/4 - k6/4 + k7/4 - k8/4, -(k1/4) +
k2/4 - k3/4 + k4/4 +
(3*k5)/4 + k6/4 - k7/4 + k8/4,
k1/4 - k2/4 + k3/4 - k4/4 + k5/4 + (3*k6)/4 + k7/4 - k8/4,
-(k1/4) + k2/4 - k3/4 + k4/4 - k5/4 + k6/4 + (3*k7)/4 + k8/4,
k1/4 - k2/4 + k3/4 - k4/4 + k5/4 -
k6/4 + k7/4 + (3*k8)/4}; p = Table[o, {n}]; k = 0;

Nest[(k++; D[#1, {norm[[k]], p[[k]]}] /. norm[[k]] -> 0) & ,  Times @@ (G^p), n]);

If you run this  with parameter 1

W[1]

you should get

167/512

and if you run it as

W[3]

it runs into the problem described. (Result should be also a rational number).
Obviously, the offending line is the Nest[] ...

Regards   Michael

```

• Prev by Date: Re: Reproducing a hash code
• Next by Date: Re: Bug of Integrate
• Previous by thread: Re: Memory requirements in Mathematica 6
• Next by thread: Re: Memory requirements in Mathematica 6