# malloc_size_of **Repository Path**: mirrors_servo/malloc_size_of ## Basic Information - **Project Name**: malloc_size_of - **Description**: Measure the heap size of values - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-16 - **Last Updated**: 2026-02-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MallocSizeOf [![Build Status](https://github.com/servo/malloc_size_of/actions/workflows/main.yml/badge.svg)](https://github.com/servo/malloc_size_of/actions) [![Crates.io](https://img.shields.io/crates/v/malloc_size_of.svg)](https://crates.io/crates/malloc_size_of) [![Docs](https://docs.rs/malloc_size_of/badge.svg)](https://docs.rs/malloc_size_of) ![Crates.io License](https://img.shields.io/crates/l/malloc_size_of) [![dependency status](https://deps.rs/repo/github/servo/malloc_size_of/status.svg)](https://deps.rs/repo/github/servo/malloc_size_of) A an allocator-agnostic crate for measuring the runtime size of a value including the size of any heap allocations that are owned by that value. This crate is used by both Servo and Firefox for memory usage calculation. ## Features - It isn't bound to a particular heap allocator. - It provides traits for both "shallow" and "deep" measurement, which gives flexibility in the cases where the traits can't be used. - It allows for measuring blocks even when only an interior pointer can be obtained for heap allocations, e.g. `HashSet` and `HashMap`. (This relies on the heap allocator having suitable support, which `jemalloc` has.) - It allows handling of types like `Rc` and `Arc` by providing traits that are different to the ones for non-graph structures.