Memory usage viewing?
Hi!
I have a script with a ton of sprites, moving objects, calculations, and more using the scene module. I have been wanting to record, or at least view the memory usage of the entire program as a whole, or isolate it down to just a function or section.
I dug around, and the modules I found installed aren’t really what I was looking for. I wanted to know if there was a built in method of viewing the applications memory usage, or any method of calculating the performance implications of my program.
I am aware of pstats and cProfile modules, but as far as I could get they only return function call and return times. Is there a built in method for getting the memory usage of pythonista?
P.S I wanted to refer more to the memory used while rendering graphics.
Second answer to https://stackoverflow.com/questions/938733
>>> import resource
>>> resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1024
Second answer to https://stackoverflow.com/questions/938733
>>> import resource >>> resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1024
This does seem to return a value, but the value never changes even as the program uses more memory. Is this a value representing the maximum amount of memory the app is allowed to use maybe?
https://docs.python.org/3/library/resource.html
https://docs.python.org/3/library/resource.html#resource-usage