-
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
Ha! I found the root cause!! If I disable the gurubase widget and Google tag manager, I won't see the detached elements any more. So I think the memory leak is coming from gurubase widget and Google tag manager. I think these 3rd party scripts might have objects the hold references to DOM elements that are used to be part of DOM. 👎 to these 3rd party components that handle GC carelessly. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
that being said, with a clean project + the todo app, there are no detached elements. I will keep digging to try to figure out what is holding on to these.. |
Beta Was this translation helpful? Give feedback.
-
created a simpler version of my project without UI but including todo app: |
Beta Was this translation helpful? Give feedback.
-
Could a
const alerter = vanX.reactive({ |
Beta Was this translation helpful? Give feedback.
-
After much digging, I've found the code that was causing most of the detached nodes const stateFields = vanX.stateFields(PR)
const skipFields = ['strokeSeed']
Object.keys(stateFields).forEach(key => {
if (skipFields.includes(key)) return
van.derive(() => {
// prnt(`${key} -> ${stateFields[key].val}`)
const fake = stateFields[key].val
PR.saveAppState()
})
}) I was trying to save this reactive object whenever any prop changed |
Beta Was this translation helpful? Give feedback.
-
More digging: setting a lower gcCycleInMs seems to solve some detached nodes (canvas nodes in this case) It feels like sometimes bigger nodes with image data are not GCd correctly. It happens when I take memory detached nodes snapshot quickly after a large change in list items (many removed) |
Beta Was this translation helpful? Give feedback.
After much digging, I've found the code that was causing most of the detached nodes
I was trying to save this reactive object whenever any prop changed