summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDemi Obenour <demiobenour@gmail.com>2017-01-10 13:33:31 -0500
committerBen Gamari <ben@smart-cactus.org>2017-01-10 13:33:38 -0500
commit12ad4d417b89462ba8e19a3c7772a931b3a93f0e (patch)
tree97b5c7e3ba6329ecf99e7431c10d43ee66758d1b /docs
parente8d74321b5b24afcb4230510fd6e4c4ecf6f3e19 (diff)
downloadhaskell-12ad4d417b89462ba8e19a3c7772a931b3a93f0e.tar.gz
Throw an exception on heap overflow
This changes heap overflow to throw a HeapOverflow exception instead of killing the process. Test Plan: GHC CI Reviewers: simonmar, austin, hvr, erikd, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2790 GHC Trac Issues: #1791
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/8.2.1-notes.rst7
-rw-r--r--docs/users_guide/runtime_control.rst14
2 files changed, 21 insertions, 0 deletions
diff --git a/docs/users_guide/8.2.1-notes.rst b/docs/users_guide/8.2.1-notes.rst
index 3011a29700..2c237db4e6 100644
--- a/docs/users_guide/8.2.1-notes.rst
+++ b/docs/users_guide/8.2.1-notes.rst
@@ -14,10 +14,17 @@ The highlights since the 8.0 branch are:
- TODO FIXME
- SCC annotations can now be used for declarations.
+- Heap overflow throws an exception in certain circumstances.
Full details
------------
+- Heap overflow throws a catchable exception, provided that it was detected
+ by the RTS during a GC cycle due to the program exceeding a limit set by
+ ``+RTS -M``, and not due to an allocation being refused by the operating
+ system. This exception is thrown to the same thread that receives
+ ``UserInterrupt`` exceptions, and may be caught by user programs.
+
Language
~~~~~~~~
diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst
index 54c7508ba8..4bde81a9d8 100644
--- a/docs/users_guide/runtime_control.rst
+++ b/docs/users_guide/runtime_control.rst
@@ -644,6 +644,20 @@ performance.
``-F`` parameter will be reduced in order to avoid exceeding the
maximum heap size.
+.. rts-flag:: -Mgrace= ⟨size⟩
+
+ :default: 1M
+
+ .. index::
+ single: heap size, grace
+
+ If the program's heap exceeds the value set by :rts-flag:`-M`, the
+ RTS throws an exception to the program, and the program gets an
+ additional quota of allocation before the exception is raised
+ again, the idea being so that the program can execute its
+ exception handlers. ``-Mgrace=`` controls the size of this
+ additional quota.
+
.. rts-flag:: --numa
--numa=<mask>