Hey guys,
I have just finished writing a program that calculates pi for as many digits as the user specifies. One thing I'm trying to do now is measure how much memory the calculation consumes. When I read articles about people that have calculated pi to several trillion digits, they usually mention that a few terabytes of memory were needed. How would I measure memory consumption with Python? Is this even possible? Thanks!
Determining memory usage for calculating pi
Page 1 of 15 Replies - 466 Views - Last Post: 28 March 2012 - 07:25 PM
Replies To: Determining memory usage for calculating pi
#2
Re: Determining memory usage for calculating pi
Posted 27 March 2012 - 09:42 PM
you got me! that's a good question.
EDIT:
Renamed your topic to reflect your actual question.
EDIT:
Renamed your topic to reflect your actual question.
This post has been edited by atraub: 28 March 2012 - 08:54 AM
#3
Re: Determining memory usage for calculating pi
Posted 27 March 2012 - 09:55 PM
#4
Re: Determining memory usage for calculating pi
Posted 28 March 2012 - 05:53 AM
You can also use sys.getsizeof() to find the amount of memory used by a particular object, which may or may not be useful to you, depending on how you wrote your code.
#5
Re: Determining memory usage for calculating pi
Posted 28 March 2012 - 06:00 AM
Hey thanks Motoma, thats exactly what I ended up doing!
#6
Re: Determining memory usage for calculating pi
Posted 28 March 2012 - 07:25 PM
Motoma, on 28 March 2012 - 05:53 AM, said:
You can also use sys.getsizeof() to find the amount of memory used by a particular object, which may or may not be useful to you, depending on how you wrote your code.
Edit, my lazy behind followed the link and found it
This post has been edited by raspinudo: 28 March 2012 - 07:33 PM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|