vue.js - Vue memory leak: each time v-if value is changed, more memory is needed
问题描述
I have many components X which themselves contain many more components. X all have a v-if=“show”. Show is triggered by the user for each X and can be triggered as many times as the user pleases. Now I figured that each time the user triggers “show” (twice) the application needs more memory. I don’t really understand why, because to my understanding the component X and all underlying components should be completely removed from memory as soon as “show” is false?
Can someone tell me why this might happen? Thanks!
解决方案
这实际上似乎是我的错误。我在一遍又一遍地触发组件后立即拍摄了快照。如果您等待几秒钟然后拍摄快照,Vue 会处理它并且内存恢复正常。
推荐阅读
- image - GIF 压缩 - Flutter
- grafana - 是否可以在 Expression Grafana Query 中获得一系列的总和?
- c# - C# 将带有 Case 语句的 SQL 查询转换为 LINQ
- javascript - 使用 nodemailer 向 gmail 发送邮件时出现问题
- mysql - 使用 CA 证书建立安全的 jdbc 连接
- java - Java String.format() 是否防止字符串注入?
- python - 从 Pyspark Column 获取值并将其与 Python 字典进行比较
- sql - SAS从一行计算多个新变量
- python - ModuleNotFoundError: No module named 'mxnet.contrib.amp' 导入 gluonnlp 时
- debugging - LLDB:用户定义别名后的制表符完成?