[Numpy-discussion] memmory management question

Georgios Exarchakis gexarcha1 at gmail.com
Sun Oct 27 22:13:03 EDT 2013


I am using numpy with ipython from anaconda and I observe the following 

    Python 2.7.5 |Anaconda 1.7.0 (64-bit)| (default, Jun 28 2013, 22:10:09)
    Type "copyright", "credits" or "license" for more information.

    IPython 1.0.0 -- An enhanced Interactive Python.
    ?         -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help      -> Python's own help system.
    object?   -> Details about 'object', use 'object??' for extra details.
    Using matplotlib backend: Qt4Agg

    In [1]: a= np.random.rand(500000,1000)

    In [2]: a = a[:10000]

    In [3]: c= np.random.rand(500000,1000)

    In [4]:

After In[1] I have an extra 3.7 GB of memory used, but this memory is 
not released at In[2]. I thought there might be some clever memory 
management trick so I executted In[3] but that just added an extra 3.7GB 
of memorry without releasing anything.

Is that the right behavior in this case?

If yes then how do you release memorry by slicing away parts of an 
array? Can you give me a description of the numpy internals in this case?

Thank you very much for your time,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20131027/fba92f36/attachment.html>

More information about the NumPy-Discussion mailing list