Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2001
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Bigger array taking less memory than smaller array

  • To: mathgroup at smc.vnet.net
  • Subject: [mg27251] Re: [mg27210] Bigger array taking less memory than smaller array
  • From: "Rasmus Debitsch" <debitsch at zeiss.de>
  • Date: Wed, 14 Feb 2001 03:41:20 -0500 (EST)
  • References: <200102120820.DAA03778@smc.vnet.net> <96asj4$6fl@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,

It has something to to with the packed array mechanism.

Here an example:

Scan[(
 t = Array[0 & , #1];
 tp = Developer`ToPackedArray[t];
 Print[
   "Length ", #1,
   " Size ", ByteCount[t],
   " / ", ByteCount[tp],
   " Packed ? ", Developer`PackedArrayQ[t]
  ];
  ) & , Range[100, 1000, 100]]

"Length "100" Size "2024" / "456" Packed ? "False
"Length "200" Size "4024" / "856" Packed ? "False
"Length "300" Size "1256" / "1256" Packed ? "True
"Length "400" Size "1656" / "1656" Packed ? "True
"Length "500" Size "2056" / "2056" Packed ? "True
"Length "600" Size "2456" / "2456" Packed ? "True
"Length "700" Size "2856" / "2856" Packed ? "True
"Length "800" Size "3256" / "3256" Packed ? "True
"Length "900" Size "3656" / "3656" Packed ? "True
"Length "1000" Size "4056" / "4056" Packed ? "True

Perhaps there is a systemparameter anywhere, to control the conversion to
packed arrays.

Regards

--

        Rasmus Debitsch
        Carl Zeiss Lithos GmbH
        Carl Zeiss Strasse
        D-73447 Oberkochen

        eMail : debitsch at zeiss.de

"Tomas Garza" <tgarza01 at prodigy.net.mx> schrieb im Newsbeitrag
news:96asj4$6fl at smc.vnet.net...
> Even more disturbing:
>
> In[1]:=
> ByteCount[Array[0 &, 200]]
> Out[1]=
> 4024
>
> In[2]:=
> ByteCount[Array[0 &, 300]]
> Out[2]=
> 1256
>
> In[3]:=
> ByteCount[Array[0 &, 1000]]
> Out[3]=
> 4056
>
> I hope someone can offer an explanation...
>
> Tomas Garza
> Mexico City
> ----- Original Message -----
> From: <Sebastien.deMentendeHorne at electrabel.com>
To: mathgroup at smc.vnet.net
> Subject: [mg27251] [mg27210] Bigger array taking less memory than smaller array
>
>
> > Hi,
> >
> > This example disturbs me...
> >
> > In[233]:=
> > ByteCount[Array[0 &, {20, 10}]]
> >
> > Out[233]=
> > 4424
> >
> > In[234]:=
> > ByteCount[Array[0 &, {30, 10}]]
> >
> > Out[234]=
> > 1260
> >
> > Some considerations about this ?
> >
> > Sébastien de Menten de Horne      |    ELECTRABEL
> > Tel:  ++32 10 48 51 76            |    R&D Energy Markets,
> > Fax:  ++32 10 48 51 09            |    Traverse d'Esope, 6
> > Gsm:  ++32 478 789 444            |    B-1348 Louvain-la-Neuve, BELGIUM
> >
>
>
>




  • Prev by Date: Re: Re: Mathematica can talk!
  • Next by Date: Re: Bigger array taking less memory than smaller array
  • Previous by thread: Re: Bigger array taking less memory than smaller array
  • Next by thread: Re: Bigger array taking less memory than smaller array