82

爱创课堂每日一题101天-哪些操作会造成内存泄漏?-12854747-51CTO博客

 6 years ago
source link: http://blog.51cto.com/12864747/2068206
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
内存泄漏指任何对象在您不再拥有或需要它之后仍然存在。垃圾回收器定期扫描对象,并计算引用了每个对象的其他对象的数量。如果一个对象的引用数量为0(没有其他对象引用过该对象),或对该对象的惟一引用是循环的,那么该对象的内存即可回收。setTimeout的第一个参数使用字符串而非函数的话,会引发内存泄漏。闭包控制台日志循环(在两个对象彼此引用且彼此保留时,就会产生一个循环)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK