# Deprecate MemoryAllocations in favor of FlutterMemoryAllocations

> MemoryAllocations is renamed to FlutterMemoryAllocations.




:::important
These breaking change docs are accurate, as of the release
under which they are published. Over time, the
workarounds described here might become inaccurate.
We don't, in general, keep these breaking change docs up
to date as of each release.

The [breaking change index file](/release/breaking-changes)
lists the docs created for each release.
:::


## Summary

Disposables in pure Dart projects can't use `MemoryAllocations` in Flutter.
So, to be leak-trackable they need a Dart-only class.
`MemoryAllocations` in Flutter is renamed to make the name
available to a non-Flutter, Dart project.

## Migration guide

Before:

```dart
if (kFlutterMemoryAllocationsEnabled) {
  MemoryAllocations.instance.dispatchObjectCreated(
    library: 'package:flutter/gestures.dart',
    className: '$MultiDragPointerState',
    object: this,
  );
}
```

After:

```dart
if (kFlutterMemoryAllocationsEnabled) {
  FlutterMemoryAllocations.instance.dispatchObjectCreated(
    library: 'package:flutter/gestures.dart',
    className: '$MultiDragPointerState',
    object: this,
  );
}
```

## Timeline

Landed in version: 3.19.0-2.0.pre<br>
Landed in stable: 3.22.0

## References

Relevant issues:

* [Rename MemoryAllocations to FlutterMemoryAllocations (Issue 140622)][]

[Rename MemoryAllocations to FlutterMemoryAllocations (Issue 140622)]: https://github.com/flutter/flutter/issues/140622

