Skip to content
This repository has been archived by the owner on Sep 14, 2018. It is now read-only.

Memory usage in range() function #114

Closed
alfred42 opened this issue May 28, 2013 · 2 comments
Closed

Memory usage in range() function #114

alfred42 opened this issue May 28, 2013 · 2 comments

Comments

@alfred42
Copy link

After I use range(1,10000001), the memory usage of IronPython will be very huge.(Up to 3GB)
Is it a bug?

@jdhardy
Copy link
Member

jdhardy commented May 28, 2013

range() does have to keep all of the values in memory, so using a lot of RAM is expected. 3 GB is a bit high, however. I just did a quick test on my Mac and IronPython (using 32-bit Mono) was 227 MB, compared to 315 MB for 64-bit CPython. PyPy, by comparison, used only 32 MB.

You can probably avoid the memory issue by using xrange() instead, but I'm curious if there's more to your application that causes it to use so much RAM.

@alfred42
Copy link
Author

Thanks a lot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants