diff options
author | Simon Marlow <marlowsd@gmail.com> | 2018-05-02 11:01:13 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2018-05-09 13:43:32 +0100 |
commit | 5fe6aaa3756cda654374ebfd883fa8f064ff64a4 (patch) | |
tree | 3b667e7100f20864a2133c3330543d74afa88ebf /docs | |
parent | ba6e445e1cf31957f2a327a73f9f66cfa7f24e26 (diff) | |
download | haskell-5fe6aaa3756cda654374ebfd883fa8f064ff64a4.tar.gz |
Add -fghci-leak-check to check for space leaks
Summary:
Space leaks in GHCi emerge from time to time and tend to come back again
after they get fixed. This is an attempt to limit regressions by
* adding a reliable detection for some classes of space leaks in GHCi
* turning on leak checking for all GHCi tests in the test suite, so that
we'll notice if the leak appears again.
The idea for detecting space leaks is quite simple:
* find some data that we expect to be GC'd later, make a weak pointer to it
* when we expect the data to be dead, do a `performGC` and then check
the status of the weak pointer.
It would be nice to apply this trick to lots of things in GHC,
e.g. ensuring that HsSyn is not retained after the desugarer, or
ensuring that CoreSyn from the previous simplifier pass is not retained.
Test Plan: validate
Reviewers: bgamari, simonpj, erikd, niteria
Subscribers: thomie, carter
GHC Trac Issues: #15111
Differential Revision: https://phabricator.haskell.org/D4658
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/ghci.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst index f5dcfe3962..a5f5764a9e 100644 --- a/docs/users_guide/ghci.rst +++ b/docs/users_guide/ghci.rst @@ -2025,6 +2025,17 @@ mostly obvious. It will create ``.ghci-history`` in current folder where GHCi is launched. +.. ghc-flag:: -fghci-leak-check + :shortdesc: (Debugging only) check for space leaks when loading + new modules in GHCi. + :type: dynamic + :reverse: -fno-ghci-leak-check + :category: + + (Debugging only) When loading new modules with ``:load``, check + that any previously loaded modules have been correctly garbage + collected. Emits messages if a leak is detected. + Packages ~~~~~~~~ |