Help with finding how much memory a variable is using

Emile van Sebille emile at fenx.com
Mon Feb 26 07:16:35 EST 2001


"Rich Somerfield" <rich_somerfield at tertio.com> wrote in
message
news:v3pm6.27666$5n4.596175 at news6-win.server.ntlworld.com...
> I dont think compression would be the way to go as this
would cause massive
> problems with performance.
>
> Technical Info:
> The reason for the huge list is basically the AI tree of
board
> representations for AI processing.  If the programme was
specialised to a
> particular game then I could implement a space saving
method of storing the
> data.  However as the code uses a config file to determine
the rules of the
> game (hence game is unknown until runtime) the AI engine
has to be
> completely generic - otherwise the code would be useless!!
>
> Look at this URL for more detailed info (and a download) :
> www.geocities.com/djterrier/SGEMain.htm
>
> The format of the list is :
> thegamelist  = [ [node, [board_representation] ] , [.....]
, [.....],
> [.....] , ..... ]
> thenodelist = [ [node, [ children_nodes ] , [.....] ,
[.....] , [.....] ,
> ..... ]
>

Can your data be structured using consistent data types?  I
recently had a situation where I needed to store a ~100,000
element list where each entry consists of 180 floats.  The
memory usage was dramatically reduced by converting the data
to use the array module.

HTH

--

Emile van Sebille
emile at fenx.com
-------------------







More information about the Python-list mailing list