A Friday 18 September 2009 16:09:58 David Fokkema escrigué:
> Hi list,
>
> I'm not sure what this is... I've written a minimal script which shows
> the following problem: fill up a table with 10 million rows, which costs
> almost no memory. Then, do the following query:
>
> r = data.root.events.col('event_id')
>
> which brings up memory usage from 14 Mb to 99 Mb. Do it again, which
> brings memory usage further up by tens of Mb's, which are freed after
> the query finishes.

This is expected.  While the query is executing, the results are being kept in 
a new NumPy array.  When the query finishes, the new NumPy object is bound to 
the `r` variable, and the old NumPy object pointed by `r` is released.

> Instead, try the following query:
>
> r = [x['event_id'] for x in data.root.events]
>
> which brings memory usage from 14 Mb to 296 Mb. Do it again, which
> brings memory usage up to 528 Mb.

Expected again.  In this case, you are getting the column as a Python list, 
and this takes *far* more space than a regular NumPy array.

> Del-ing objects and imports doesn't clean up memory...

It should.  How are you deleting objects, and how do you determine that memory 
is not being released?

-- 
Francesc Alted

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to