Is there a way to limit the memory, ghci can have?

前端 未结 2 538
灰色年华
灰色年华 2020-12-16 15:32

I\'m used to debug my code using ghci. Often, something like this happens (not so obvious, of course):

ghci> let f@(_:x) = 0:1:zipWith(+)f x
ghci> leng         


        
2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-16 16:09

    Running it under a shell with ulimit -m set is a fairly easy way. If you want to run with some limit on a regular basis, you can create a wrapper script that does ulimit before running ghci.

提交回复
热议问题