#4322: High CPU usage during idle time due to GC
-------------------------------+--------------------------------------------
Reporter: hesselink | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Runtime System | Version: 6.12.3
Keywords: idle GC | Testcase:
Blockedby: | Difficulty:
Os: MacOS X | Blocking:
Architecture: x86 | Failure: Runtime performance bug
-------------------------------+--------------------------------------------
Comment(by simonmar):
The idle GC is supposed to run just once, and then the application should
go idle. However, there are some things that can cause it to run
repeatedly:
* the idle GC invokes a finalizer; the finalizer creates a new
finalizable object, which then gets finalized by the next idle GC, and so
on
* the idle GC detects a deadlocked thread and sends it an exception. The
deadlocked thread catches the exception and proceeds to deadlock again.
* if your application has a timer signal that executes some Haskell code
every 1s, say, then you'll get an idle GC after each one. Setting the
idle GC to a longer period than your timer signal (e.g. 2s) will prevent
this happening.
In the case of #3408, the latter was happening: the Windows console was
sending events every 1s, which caused some code to execute in GHCi.
So my question is, does any of these scenarios apply to you? You can
compile the program with `-debug` and watch the events with `+RTS -Ds` to
see what is happening during the idle time. On a Unix system, `strace`
may help too, or Process Monitor on Windows.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4322#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs