[Git][ghc/ghc][wip/andreask/allocationArea] Increase -A and -O rts defaults to 4MB.
Andreas Klebinger
gitlab at gitlab.haskell.org
Mon Jul 13 11:48:09 UTC 2020
Andreas Klebinger pushed to branch wip/andreask/allocationArea at Glasgow Haskell Compiler / GHC
Commits:
444c1e0e by Andreas Klebinger at 2020-07-13T13:47:58+02:00
Increase -A and -O rts defaults to 4MB.
Fixes #16499
- - - - -
2 changed files:
- docs/users_guide/runtime_control.rst
- rts/RtsFlags.c
Changes:
=====================================
docs/users_guide/runtime_control.rst
=====================================
@@ -401,7 +401,7 @@ performance.
.. rts-flag:: -A ⟨size⟩
- :default: 1MB
+ :default: 4MB
.. index::
single: allocation area, size
@@ -410,15 +410,22 @@ performance.
collector. The allocation area (actually generation 0 step 0) is
fixed and is never resized (unless you use :rts-flag:`-H [⟨size⟩]`, below).
- Increasing the allocation area size may or may not give better
- performance (a bigger allocation area means worse cache behaviour
- but fewer garbage collections and less promotion).
+ Optimal settings depend on the actual machine, program, and other RTS options.
+ Increasing the allocation area size means worse cache behaviour
+ but fewer garbage collections and less promotion.
+
+ In general settings >= 4MB can reduce performance in some cases, in particular for single
+ threaded operation. However in a parallel setting increasing the allocation area
+ to ``16MB``, or even ``64MB`` can increase gc throughput significantly.
With only 1 generation (e.g. ``-G1``, see :rts-flag:`-G ⟨generations⟩`) the
``-A`` option specifies the minimum allocation area, since the actual size
of the allocation area will be resized according to the amount of data in
the heap (see :rts-flag:`-F ⟨factor⟩`, below).
+ When heap profiling using a smaller allocation area can increase accuracy as more frequent
+ major garbage collections also results in more frequent heap snapshots
+
.. rts-flag:: -AL ⟨size⟩
:default: :rts-flag:`-A <-A ⟨size⟩>` value
@@ -450,7 +457,7 @@ performance.
.. rts-flag:: -O ⟨size⟩
- :default: 1m
+ :default: 4m
.. index::
single: old generation, size
=====================================
rts/RtsFlags.c
=====================================
@@ -152,10 +152,11 @@ void initRtsFlagsDefaults(void)
RtsFlags.GcFlags.stkChunkSize = (32 * 1024) / sizeof(W_);
RtsFlags.GcFlags.stkChunkBufferSize = (1 * 1024) / sizeof(W_);
- RtsFlags.GcFlags.minAllocAreaSize = (1024 * 1024) / BLOCK_SIZE;
+ /* -A default. See #16499 for a discussion about the tradeoffs */
+ RtsFlags.GcFlags.minAllocAreaSize = (4 * 1024 * 1024) / BLOCK_SIZE;
RtsFlags.GcFlags.largeAllocLim = 0; /* defaults to minAllocAreasize */
RtsFlags.GcFlags.nurseryChunkSize = 0;
- RtsFlags.GcFlags.minOldGenSize = (1024 * 1024) / BLOCK_SIZE;
+ RtsFlags.GcFlags.minOldGenSize = (4 * 1024 * 1024) / BLOCK_SIZE; /* -O default */
RtsFlags.GcFlags.maxHeapSize = 0; /* off by default */
RtsFlags.GcFlags.heapLimitGrace = (1024 * 1024);
RtsFlags.GcFlags.heapSizeSuggestion = 0; /* none */
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/444c1e0e9df29e3323bec9cf5d50fb88c57eaafa
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/444c1e0e9df29e3323bec9cf5d50fb88c57eaafa
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200713/b6209384/attachment-0001.html>
More information about the ghc-commits
mailing list