# Extremely high memory consumption on CPU

**URL:** <https://discourse.julialang.org/t/extremely-high-memory-consumption-on-cpu/124733>\
**Category:** General Usage\
**Tags:** benchmarktools, flux\
**Created:** [January 13, 2025, 5:00pm UTC](https://discourse.julialang.org/t/extremely-high-memory-consumption-on-cpu/124733 "2025-01-13T17:00:10Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [January 13, 2025, 6:20pm UTC](https://discourse.julialang.org/t/extremely-high-memory-consumption-on-cpu/124733/3 "2025-01-13T18:20:22Z")

</div>

> [@cirobr](#):
>
> I wonder if BenchmarkTools is not considering GPU memory for the metric?

This is correct. To capture information about GPU allocations, check out the tools mentioned in [Benchmarking & profiling · CUDA.jl](https://cuda.juliagpu.org/stable/development/profiling/#Time-measurements).

> [@cirobr](#):
>
> For the CPU case, does the metric mean the model is too expensive for running on limited devices such as IoT application processors?

Maybe, maybe not. Equally if not more important than the total amount of memory allocated could be the maximum memory the model uses at any given point in time.

> [@cirobr](#):
>
> As a side question: its speed on gpu is 2-3X lower than equivalent models found elsewhere on GitHub. Have already applied many recommendations to reduce allocation, with little improvement. Any hint on where to look at for improvement tips is welcome.

There’s no central, definitive source, but plenty of previous discussions to search through with the obvious keywords. Just in the past little while on Discourse, I see [Unreasonable memory usage with M4 GPU](https://discourse.julialang.org/t/unreasonable-memory-usage-with-m4-gpu/123890) and [Memory usage increasing with each epoch - #14 by JoshuaBillson](https://discourse.julialang.org/t/memory-usage-increasing-with-each-epoch/121798/14). While on GitHub, [cuda gpu memory usage increasing in time · Issue #2523 · FluxML/Flux.jl · GitHub](https://github.com/FluxML/Flux.jl/issues/2523) covers much the same. There have been similar discussions on Slack.

Side note, are you aware of the existence of [Machine Learning - Julia Programming Language](https://discourse.julialang.org/c/domain/ml/24) ? Posts that are in too general a category can get lost, because some people only check specific categories frequently.

---

_[View the full topic](https://discourse.julialang.org/t/extremely-high-memory-consumption-on-cpu/124733)._
