How to cap memory usage of Haskell threads

我的未来我决定 提交于 2019-12-03 04:40:35

Edward Z. Yang and David Mazières have developed an extension to GHC that supports dynamic resource limits, and discuss it at http://ezyang.com/rlimits.html They also provide a version of GHC 7.8 that supports this.

Unfortunately, their work was not included in GHC upstream.

May not be exactly what you want. But, as documented here you have a ghc compile option: -Ksize, update: Oops, sorry, -K is for stack overflows. Still, you can check that link.

In your example, you may need to modify the source of the scripting language interpreter, make some twists to the memory mgmt. module(s), of course IF it has some managed memory allocation features, the interpreter can complain about an execessive use of memory quota by an API callback to your host application.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!