# Finding memory leaks with Memtrace

DevFeed: [Finding memory leaks with Memtrace](<https://devfeed.tech/articles/finding-memory-leaks-with-memtrace-20166.md>)

Original publisher: [Read original article](<https://blog.janestreet.com/finding-memory-leaks-with-memtrace/>)

Author: Luke Maurer

Published: 2020-10-06T00:00:00Z

Content type: release

Language: en

Sources: [Jane Street](<https://devfeed.tech/sources/jane-street.md>)

Topics: [Memory Leaks](<https://devfeed.tech/topics/memory-leaks.md>), [OCaml](<https://devfeed.tech/topics/ocaml.md>), [Library](<https://devfeed.tech/topics/library.md>), [Data visualization](<https://devfeed.tech/topics/data-visualization.md>)

Tags: [compiler](<https://devfeed.tech/tags/compiler.md>), [data-visualization](<https://devfeed.tech/tags/data-visualization.md>), [library](<https://devfeed.tech/tags/library.md>), [memory-leaks](<https://devfeed.tech/tags/memory-leaks.md>), [ocaml](<https://devfeed.tech/tags/ocaml.md>), [production](<https://devfeed.tech/tags/production.md>), [profiling](<https://devfeed.tech/tags/profiling.md>)

## AI overview

Jane Street introduces Memtrace, an OCaml library and viewer for investigating memory and space leaks. It records sampled allocation events and their lifetimes, then presents visualizations and filters to help identify suspicious memory usage.

## Source excerpt

Memory issues can be hard to track down. A function that only allocates a few small objects can cause a space leak if it's called often enough and those objects are never collected. Even then, many objects are supposed to be long-lived. How can a tool, armed with data on allocations and their lifetimes, help sort out the expected from the suspicious?