Im trying to find a Python 2.7 memory profiler (for windows +64bit python) all I can find are the 2.6 versions.
How do I find out how much physical memory an array is using in memory
other than doing the calculation of "well this is two bytes and I have
1000 of them that means 2000 bytes" ......
I don't know the answer to your first question, but if, by "array", you mean a NumPy array, you can use the nbytes property:
>>> a = numpy.arange(10**6).reshape(10**4, 10**2)
The answer is as you said (a.itemsize * a.size). The actual number of bytes will be a small fixed number of bytes more than the contents (because of the overhead of the ndarray pointers to dtype etc.), but this is usually negligible.
Although a closer reading may mean that you have a particular one in
mind, but just need a version compiled for 2.7. Is that the case?
If that is the case, the blogger at blog.vrplumber.com may be able to
help as I know he has used meliae and may have used it for 2.7.
On Mon, 2011-04-18 at 11:49 +1000, David Crisp wrote:
> Im trying to find a Python 2.7 memory profiler (for windows +64bit
> python) all I can find are the 2.6 versions.
> How do I find out how much physical memory an array is using in memory
> other than doing the calculation of "well this is two bytes and I have
> 1000 of them that means 2000 bytes" ......
> David ps - have changed my mailignlist address to gmail
> melbourne-pug mailing list
> [hidden email] > http://mail.python.org/mailman/listinfo/melbourne-pug