# Out of GPU memory with user defined function

**URL:** <https://discourse.julialang.org/t/out-of-gpu-memory-with-user-defined-function/74914>\
**Category:** Performance\
**Tags:** question, cuda\
**Created:** [January 20, 2022, 8:30am UTC](https://discourse.julialang.org/t/out-of-gpu-memory-with-user-defined-function/74914 "2022-01-20T08:30:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadir-gunel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kadir-gunel/32/35790_2.png) [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Post date:** [January 20, 2022, 8:30am UTC](https://discourse.julialang.org/t/out-of-gpu-memory-with-user-defined-function/74914/1 "2022-01-20T08:30:27Z")

</div>

This post was temporarily hidden by the community for possibly being off-topic, unfocused, inappropriate, or spammy.

---

<div class="post-metadata">

**Author:** ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)\
**Post date:** [January 20, 2022, 8:40am UTC](https://discourse.julialang.org/t/out-of-gpu-memory-with-user-defined-function/74914/2 "2022-01-20T08:40:00Z")

</div>

> [@kadir-gunel](#):
>
> `ERROR: Out of GPU memory trying to allocate 149.012 GiB`

Something is fishy:

```julia
function test()
    X = rand(300, Int(40e3));
    Y = rand(Int(40e3), 300);
    Y * X
end

@btime test()

```

reports

```julia
6.625 s (6 allocations: 12.10 GiB)

```
