# Loading views from serialized file disconnects memory link

**URL:** <https://discourse.julialang.org/t/loading-views-from-serialized-file-disconnects-memory-link/102335>\
**Category:** General Usage\
**Tags:** question, views, serialization\
**Created:** [July 31, 2023, 9:31pm UTC](https://discourse.julialang.org/t/loading-views-from-serialized-file-disconnects-memory-link/102335 "2023-07-31T21:31:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwhisena](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@mwhisena](https://discourse.julialang.org/u/mwhisena)\
**Post date:** [July 31, 2023, 9:31pm UTC](https://discourse.julialang.org/t/loading-views-from-serialized-file-disconnects-memory-link/102335/1 "2023-07-31T21:31:10Z")

</div>

I have a large matrix of data that I wish to create hundreds of views from. These views help me with setindexing and actually using my data in the program. This works perfectly for me, especially if I want to deepcopy to make different versions of the matrix.

However, when using the Serialization package, I notice that the views are decoupled pointers to the actual matrix ie. the views no longer update the matrix with setindex. Here is a minimal example:

```julia
# Make matrix and views
x = rand(100, 100)
xv = [view(x, i, :) for i in axes(x, 1)]

# Struct to hold views and data together
struct test
    x
    xv
end
mytest = test(x, xv)

# Example of updating, works!
setindex!(mytest.xv[1], 1:100, :)

using Serialization

# Save and load to new struct
serialize("myteststruct", mytest)
myload = deserialize("myteststruct")

# Example of updating, decoupled!
setindex!(myload.xv[1], 101:200, :)

```

Is this intended or something easy that I’m missing. Didn’t really see any topics on this. Any help would be appreciated.
