# Memory Allocation of Channel Buffers of type Array

**URL:** <https://discourse.julialang.org/t/memory-allocation-of-channel-buffers-of-type-array/15655>\
**Category:** Julia at Scale\
**Created:** [September 29, 2018, 7:55am UTC](https://discourse.julialang.org/t/memory-allocation-of-channel-buffers-of-type-array/15655 "2018-09-29T07:55:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohanmclure](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rohanmclure/32/5912_2.png) [@rohanmclure](https://discourse.julialang.org/u/rohanmclure)\
**Post date:** [September 29, 2018, 7:55am UTC](https://discourse.julialang.org/t/memory-allocation-of-channel-buffers-of-type-array/15655/1 "2018-09-29T07:55:27Z")

</div>

I have distributed workers wishing to perform an in-place distributed transpose. In this particular example, each worker has access to a ‘column block’ of a dense matrix, and workers must send off-diagonal sections of the matrix to other workers.

So far this is implemented by means of (buffer size one) RemoteChannels, generated like so:

```julia
RemoteChannel(()->Channel{Array{Float64,2}}(1))

```

If a worker, ‘n’ needs to communicate with another ‘m’, then ‘n’ will retrieve a copy of the RemoteChannel object from ‘m’ via serialisation.

The blocks of the matrix that must be sent in this way can be of variable size, but the maximum size required can be specified by the program.

My question is - does there exist a way of specifying on creation of a Channel of Bit-type matrices what the maximum size of the matrix and avoiding reallocation of the Channel buffer on repeated usage?

I want to ensure that every invocation of `take!` from the Channel owner will return a reference to exactly one memory region.

Thanks
