webkit - 如何减少phantomjs内存消耗?

标签 webkit automated-tests phantomjs

我使用 phantomjs 和 casperjs 来运行多个测试,看起来 PhantomJS 的每个实例都需要大约 106M 的 RAM。有没有可能减少这个数额?有没有一种简单的方法可以在多个“选项卡”中运行测试?

最佳答案

编辑:正如@newfurniturey 所指出的,release 现在已被弃用。我们必须使用关闭:
http://phantomjs.org/api/webpage/method/close.html

不知道这是否有帮助,但释放功能可能是一个很好的尾部:
http://phantomjs.org/api/webpage/method/release.html

Releases memory heap associated with this page. Do not use the page instance after calling this.

Due to some technical limitation, the web page object might not be completely garbage collected. This is often encountered when the same object is used over and over again. Calling this function may stop the increasing heap allocation.



:)

关于webkit - 如何减少phantomjs内存消耗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8647980/

相关文章:

python - 自动化 REST 服务测试所需的建议

javascript - TestCafe ClientFunction TypeError 错误,因为文档未定义

pdf - Phantomjs zoomFactor - 将光栅化缩放到特定大小

node.js - 来自 node.js 的 phantomjs 调用 uing spawn 似乎不执行脚本

node.js - heroku 上 phantomjs 的分页内部支持

ios - WKWebView+contentInset 使内容大小错误

iOS5 使用 webkit-overflow-scrolling 滚动时图像消失 : touch

ajax - 使用 FormData 上传 blob,文件内容为空

android - 在 Android 的对话框中加载 webview 时获取 void android.webkit.WebView.loadUrl?

javascript - 如何在 Nightwatch 中打开新的浏览器选项卡或新的浏览器窗口(共享 session )?