# Memory error out of gc handles

**URL:** https://discourse.julialang.org/t/memory-error-out-of-gc-handles/40985
**Category:** General Usage
**Created:** [June 8, 2020, 11:45am UTC](https://discourse.julialang.org/t/memory-error-out-of-gc-handles/40985 "2020-06-08T11:45:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [June 8, 2020, 11:45am UTC](https://discourse.julialang.org/t/memory-error-out-of-gc-handles/40985/1 "2020-06-08T11:45:49Z")

</div>

I know I will be shown for a fool here…  
My laptop runs Windows 10 , Julia 1.5 32 gigabytesof RAM  
Using StaticArrays I cannot allocate a 100 by 100 array

```julia

julia> using StaticArrays

julia> @allocated A=@SMatrix zeros(90,90)
64896

julia> @allocated A=@SMatrix zeros(100,100)
ERROR: syntax: invalid syntax (memory-error out of gc handles)
Stacktrace:
 [1] top-level scope at REPL[49]:1
 [2] macro expansion at C:\Users\john_hearns\.julia\packages\StaticArrays\mlIi1\src\SMatrix.jl:35 [inlined]
 [3] SArray at C:\Users\john_hearns\.julia\packages\StaticArrays\mlIi1\src\SMatrix.jl:32 [inlined]
 [4] macro expansion at C:\Users\john_hearns\.julia\packages\StaticArrays\mlIi1\src\arraymath.jl:10 [inlined]
 [5] _zeros at C:\Users\john_hearns\.julia\packages\StaticArrays\mlIi1\src\arraymath.jl:2 [inlined]
 [6] zeros at C:\Users\john_hearns\.julia\packages\StaticArrays\mlIi1\src\arraymath.jl:1 [inlined]
 [7] macro expansion at C:\Users\john_hearns\.julia\packages\StaticArrays\mlIi1\src\SMatrix.jl:159 [inlined]
 [8] top-level scope at .\timing.jl:267 [inlined]
 [9] top-level scope at .\REPL[49]:0

```

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [June 8, 2020, 11:47am UTC](https://discourse.julialang.org/t/memory-error-out-of-gc-handles/40985/2 "2020-06-08T11:47:52Z")

</div>

Answerign my own question, the docs do say that StaticArrays should not be used for larger than 100x100

As a teaching poitn can someone explain why, in simple terms. Thanks.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [June 8, 2020, 12:00pm UTC](https://discourse.julialang.org/t/memory-error-out-of-gc-handles/40985/3 "2020-06-08T12:00:37Z")

</div>

> [@johnh](#):
>
> the docs do say that StaticArrays should not be used for larger than 100x100
> 
> As a teaching poitn can someone explain why, in simple terms. Thanks.

The README explains it: see the last paragraph in the section

> **[GitHub - JuliaArrays/StaticArrays.jl: Statically sized arrays for Julia](https://github.com/JuliaArrays/StaticArrays.jl#speed)**
>
> Statically sized arrays for Julia. Contribute to JuliaArrays/StaticArrays.jl development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [June 8, 2020, 1:38pm UTC](https://discourse.julialang.org/t/memory-error-out-of-gc-handles/40985/4 "2020-06-08T13:38:24Z")

</div>

Also note that the manual says 100 **elements** , not 100 **by** 100 elements - you’ve got 10,000 elements in your 100x100 static array.

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [June 8, 2020, 2:14pm UTC](https://discourse.julialang.org/t/memory-error-out-of-gc-handles/40985/5 "2020-06-08T14:14:10Z")

</div>

Thankyou!
