# Browser side memory leaks using InteractNext.jl

**URL:** https://discourse.julialang.org/t/browser-side-memory-leaks-using-interactnext-jl/9170
**Category:** Web Stack
**Tags:** guis, visualization
**Created:** [February 19, 2018, 3:44pm UTC](https://discourse.julialang.org/t/browser-side-memory-leaks-using-interactnext-jl/9170 "2018-02-19T15:44:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jwikmark](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jwikmark/32/3526_2.png) [@jwikmark](https://discourse.julialang.org/u/jwikmark)
#### Post date: [February 19, 2018, 3:44pm UTC](https://discourse.julialang.org/t/browser-side-memory-leaks-using-interactnext-jl/9170/1 "2018-02-19T15:44:35Z")

</div>

Hello, I’m having an issue with browser side memory leaks when using the InteractNext.jl ([https://github.com/JuliaGizmos/InteractNext.jl](https://github.com/JuliaGizmos/InteractNext.jl)) package. Running the svg example (the first example in the readme) and serving it with Mux causes memory leaks in the browser (or in electron if served with Blink) after playing around with the widgets for a while. In Chrome, the page crashes after using ~1.5GB of memory. Has anyone else encountered this issue and managed to solve it? Any help or pointers would be appreciated.

Edit: This was caused by WebIO.newid being run each time the graphic was updated. I managed to solve it by overwriting the WebIO.newid function to reuse old id names.

---

<div class="post-metadata">

### Author: ![shashi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shashi/32/1824_2.png) [@shashi](https://discourse.julialang.org/u/shashi)
#### Post date: [February 22, 2018, 6:42am UTC](https://discourse.julialang.org/t/browser-side-memory-leaks-using-interactnext-jl/9170/2 "2018-02-22T06:42:27Z")

</div>

pretty cool that you figured out the problem! I guess we need to address this before releasing. At least in `@manipulate` we should try and reuse widget context. @jobjob

---

<div class="post-metadata">

### Author: ![jwikmark](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jwikmark/32/3526_2.png) [@jwikmark](https://discourse.julialang.org/u/jwikmark)
#### Post date: [February 25, 2018, 12:00pm UTC](https://discourse.julialang.org/t/browser-side-memory-leaks-using-interactnext-jl/9170/3 "2018-02-25T12:00:44Z")

</div>

I came up with a solution that fits my purposes better and thought I’d share it in case you have any use for it. Naming a node will force the container to retain the id. I added the following to the Base.show function from node.jl in WebIO.

```julia

if haskey(x.props, :id)
		id = "$(x.props[:id])-parent"
else
		id = WebIO.newid("node")
end

```

---

<div class="post-metadata">

### Author: ![shashi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shashi/32/1824_2.png) [@shashi](https://discourse.julialang.org/u/shashi)
#### Post date: [February 27, 2018, 7:32pm UTC](https://discourse.julialang.org/t/browser-side-memory-leaks-using-interactnext-jl/9170/4 "2018-02-27T19:32:09Z")

</div>

Thanks, that definitely helps! I suspect the problem is with mounting a Vue instance on elements with new ids every time.
