Skip to main content
GameDev.net gamedev.net
🔒 Locked

programmatically determine python object size

Started by nihilisticod Sep 30, 2008 at 4:51 PM 1 replies 1.9k views
Original Post
nihilisticod
nihilisticod
Is there a way to programmatically find (or atleast estimate) the memory footprint of a python object? Is there a standard memory usage/overhead for each builtin object type such that I could recursively compute the size of an object? It does not have to be a precise value since I am not concerned with the total memory use, just the relative memory use of several object heirarchies. Generally, I want to see how much memory various lists of various object types are using in comparison to eachother? Removing different lists while running and examining the overall process' memory usage is not a viable solution. I know that if I am that concerned about memory usage and have performance problems that I should write the time-critical code in C++. For a number of reasons, that is not an option. Thanks
nihilisticod
nihilisticod
thanks, they look like they will do the trick.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.