{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/5"}],"enrichment":{"capability":"Measures the complete memory footprint of Python objects including their nested children, using garbage collection to traverse object graphs and calculate deep size in bytes.","skillfed_tags":["memory-profiling","debugging","object-introspection"],"use_cases":["Debug memory leaks by measuring which objects and their children are consuming unexpected amounts of memory.","Profile data structure efficiency by comparing deep sizes of different implementations to find the most memory-efficient design.","Monitor memory usage in long-running applications by periodically checking the size of key objects to detect gradual bloat.","Analyze neural network models (e.g., torch tensors) by providing custom size handlers for framework-specific object types.","Validate that cached or pooled objects aren't growing unexpectedly by comparing their sizes across application lifecycle."],"what_it_does":"objsize is a Python library that calculates how much memory an object and all its nested children consume, measured in bytes. It uses Python's garbage collection mechanism to traverse object graphs without recursive calls, making it faster and safer than naive approaches. The package automatically filters out shared objects like None, types, modules, classes, and functions, since these are typically shared across many instances and shouldn't be counted multiple times.\n\nYou can measure single objects, multiple objects at once, or exclude specific subtrees from the calculation. The library offers customization hooks: you can define your own size calculation, referent discovery, and filtering logic to handle special cases like torch tensors or weakref proxies that don't expose their memory through Python's standard introspection. It also provides a traversal API to walk the entire object graph yourself.","worth_installing":"Yes. objsize is a straightforward, dependency-free memory profiling tool with no known vulnerabilities, permissive licensing, and broad Python version support. Install it if you need to measure object memory consumption beyond what sys.getsizeof() provides. The aging maintenance status is not a blocker for a stable utility library, but check the documentation to confirm it handles your Python version and object types."},"id":"objsize","links":{"html":"https://skillfed.io/packages/objsize","md":"https://skillfed.io/packages/objsize.md","pypi":"https://pypi.org/project/objsize/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2026-01-18","license_spdx":null,"license_treatment":"permissive","name":"objsize","python_support":"supports_current","summary":"Traversal over Python's objects subtree and calculate the total size of the subtree in bytes (deep size)."},"popularity":{"monthly_downloads":2995494,"position":2795,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.8.0"}
