# scope_profiler.memray

*module*

Optional Memray allocation-trace integration.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/memray.py#L1-L1)

## scope_profiler.memray.MemrayAllocationTracker

*class*

```python
class MemrayAllocationTracker
```

Start and stop one optional process-wide Memray allocation capture.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/memray.py#L6-L44)

### scope_profiler.memray.MemrayAllocationTracker.path

*attribute* · *instance attribute*

```python
path = Path(path)
```

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/memray.py#L26-L26)

### scope_profiler.memray.MemrayAllocationTracker.start

*method*

```python
def start() -> None
```

Enable allocation tracking for this process.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/memray.py#L35-L38)

### scope_profiler.memray.MemrayAllocationTracker.stop

*method*

```python
def stop() -> None
```

Flush and close the capture. Safe to call more than once.

[View source](https://github.com/max-models/scope-profiler/blob/devel/src/scope_profiler/memray.py#L40-L44)
