# 使用 Homebrew, apk, dnf, Nix, pacman 安装 memray

查看 memray 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:memray
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install memray
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add memray
```

  证据: Alpine Linux edge package indexes: memray from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- dnf (92%):

```sh
sudo dnf install memray
```

  证据: Fedora Rawhide package metadata: memray from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#memray
```

  证据: nixpkgs package indexes: pkgs/by-name/me/memray/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S memray
```

  证据: Arch Linux sync databases: memray from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

## 软件包事实

- **软件包键:** brew:memray
- **软件包管理器:** Homebrew
- **版本:** 1.19.3
- **来源摘要:** Memory profiler for Python applications
- **主页:** <https://bloomberg.github.io/memray/>
- **最后更新:** 2026-06-22T14:05:27-07:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- memray (别名)
- memray3.14 (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.19.3
## 项目历史与用法

Memray is a Bloomberg Python memory profiler that tracks allocations in Python code, native extension modules, and the Python interpreter, then renders reports such as flame graphs, terminal summaries, tables, trees, live views, and stats.

### 项目历史

Memray's README and documentation present it as a profiler for allocation tracing rather than sampling alone. It records function call stacks for allocations, can include native C/C++ frames, works with Python threads and native threads, and can be used both as a CLI and as a Python library.

The package entered public Python packaging with a 1.0.0 release on PyPI in April 2022. Its release stream continued through the 1.x line, with GitHub release notes and PyPI metadata showing active maintenance into 2026.

### 采用历史

Memray is distributed through Python packaging and system package managers. The upstream README links PyPI, PyPI download statistics, conda-forge, GitHub Actions for wheels, and documentation; the batch input lists apk, Homebrew, Fedora, Nix, and Arch packages. The README also points to `pytest-memray`, which brought Memray into test-suite workflows as well as ad hoc command-line profiling.

### 使用方式

The common CLI workflow is `python3 -m memray run -o output.bin my_script.py`, followed by a reporter such as `python3 -m memray flamegraph output.bin`. Users can also run `memray run my_script.py`, use `memray run -m my_module`, enable native tracking with `--native`, attach to processes in supported scenarios, or use the API for finer-grained profiling.

Memray is limited to Linux and macOS. Because it includes a C extension and native tooling, source builds may require dependencies such as libdebuginfod, libunwind, and liblz4, while normal users are steered toward binary wheels from PyPI.

### 为什么软件包爱好者会关心

Memray is notable because Python memory profiling often crosses the Python/native boundary. Packaging it means shipping compiled extensions, platform-specific wheels, and native library integration while still exposing a friendly CLI. It is also a useful package-index signal because it bridges Python developers, C-extension debugging, flamegraph tooling, and pytest integration.

### 时间线

- 2022-04-09: memray 1.0.0 uploaded to PyPI.
- 2022: README documents Linux and macOS support, PyPI installation, native allocation tracking, and multiple reporters.
- 2026-04-08: v1.19.3 GitHub release published.

### Related projects

- Related projects include pytest-memray for test integration, PyPI and conda-forge as distribution channels, and native debugging/profiling dependencies such as libunwind, libdebuginfod, and liblz4.

### 来源

- <https://bloomberg.github.io/memray/>
- <https://github.com/bloomberg/memray#readme>
- <https://github.com/bloomberg/memray/releases.atom>
- <https://pypi.org/pypi/memray/json>
- source_facts.package-manager-url


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Nix - memray: normalized package name match | nixpkgs package indexes: pkgs/by-name/me/memray/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - memray - 1.19.3-r0: normalized package name match | Alpine Linux edge package indexes: memray from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Memray is a memory profiler for Python | https://bloomberg.github.io/memray/
- apk - memray-pyc - 1.19.3-r0: normalized package name match | Alpine Linux edge package indexes: memray-pyc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Precompiled Python bytecode for memray | https://bloomberg.github.io/memray/
- dnf - memray - 1.13.4-10.fc45: normalized package name match | Fedora Rawhide package metadata: memray from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Memory profiler for Python applications | https://bloomberg.github.io/memray/
- pacman - memray - 1.19.3-1: normalized package name match | Arch Linux sync databases: memray from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A memory profiler for Python | https://github.com/bloomberg/memray


## Combined YAML source

View the package source record on GitHub. [combined/memray.yml](https://github.com/mxcl/pkgdb/blob/main/combined/memray.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
