测试代码如下: ```html ``` 通过tab timeline观测到在第3900ms时,系统有一个garbage collection的operation, 总共回收内存425k: ![image](https://user-images.githubusercontent.com/5669954/27145480-429f1174-5136-11e7-90e4-212a9cb557ec.png) garbage collection能够生效的原因是因为在每次timer trigger并且执行完毕后,当前execution environment里的局部变量newArray 引用计数为0,因此可以被回收: ![image](https://user-images.githubusercontent.com/5669954/27145494-5288c9b8-5136-11e7-811a-a344a5d43166.png) 如果将该定义成局部变量的array改成全局变量,则GC不会再发生: ```html ``` ![image](https://user-images.githubusercontent.com/5669954/27145512-602bc46c-5136-11e7-8256-6f940eda6b1a.png)