<div dir="auto">This can be done using RTS options I believe. Compile with -rtsopts and then run your program with +RTS -help and look for the heap options.<div dir="auto"><br></div><div dir="auto">If you want to scope it within your program, I'm not sure about that.</div><div dir="auto"><br></div><div dir="auto">Ollie</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 Dec 2017 1:24 pm, "Johannes Waldmann" <<a href="mailto:johannes.waldmann@htwk-leipzig.de">johannes.waldmann@htwk-leipzig.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Cafe.<br>
<br>
is there an easy way (in GHC Haskell)<br>
to run a computation until it (times out or)<br>
requires more than X MB of heap?<br>
<br>
(the main program has a larger heap,<br>
but the computation should use some part of it only)<br>
<br>
This would be nice for automated tests<br>
with predictable resources (time and space).<br>
<br>
There is Control.Timeout.<br>
I guess I want Control.Spaceout.<br>
<br>
- J.<br>
<br>
______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div></div>