# What does mean if memory allocations are shown on struct elements?

**URL:** <https://discourse.julialang.org/t/what-does-mean-if-memory-allocations-are-shown-on-struct-elements/51212>\
**Category:** Performance\
**Created:** [December 3, 2020, 5:20pm UTC](https://discourse.julialang.org/t/what-does-mean-if-memory-allocations-are-shown-on-struct-elements/51212 "2020-12-03T17:20:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuergenD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juergend/32/18970_2.png) [@JuergenD](https://discourse.julialang.org/u/JuergenD)\
**Post date:** [December 3, 2020, 5:20pm UTC](https://discourse.julialang.org/t/what-does-mean-if-memory-allocations-are-shown-on-struct-elements/51212/1 "2020-12-03T17:20:55Z")

</div>

Hi,

using `julia --track-allocation=user` the following extract was written into a \*.mem file. What does it mean when track-allocation reports memory allocations on a specific element of the struct? Where do I need to look to fix it?

```julia
          - struct FWIndex{F<:AbstractField, R<:AbstractRecord} <: AbstractIndex{F}
 47114528 fwf::FWFile{R}
          - field::F

```

The result is pretty much the same, no matter whether I specify FWFile fully or not.

```julia
          - struct FWIndex{F<:AbstractField} <: AbstractIndex{F}
 47114528 fwf::FWFile
          - field::F

```

Created is it like below. Hence, no FWFile is created, but memory allocations are obviously required.

```julia
function FWIndex(fwf::FWFile{R}) where R
   ...
   FWIndex{typeof(field), R}(fwf, ...)

```

thanks a lot for your help
