You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For more information about some of these settings, see the [Middle ground between workstation and server GC](https://devblogs.microsoft.com/dotnet/middle-ground-between-server-and-workstation-gc/) blog entry.
@@ -417,15 +417,12 @@ For more information about some of these settings, see the [Middle ground betwee
417
417
}
418
418
```
419
419
420
-
### Heap limit
420
+
### Heap hard limit
421
421
422
-
-Specifies the maximum commit size, in bytes, for the GC heap and GC bookkeeping.
422
+
-The heap hard limit is defined as the maximum commit size, in bytes, for the GC heap and GC bookkeeping.
423
423
- This setting only applies to 64-bit computers.
424
-
- This setting is ignored if the [Per-object-heap limits](#per-object-heap-limits) are configured.
425
-
- The default value, which only applies in certain cases, is the greater of 20 MB or 75% of the memory limit on the container. The default value applies if:
426
-
427
-
- The process is running inside a container that has a specified memory limit.
428
-
-[System.GC.HeapHardLimitPercent](#heap-limit-percent) is not set.
424
+
- If this limit isn't configured but the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, a default value is set. That default is the greater of 20 MB or 75% of the memory limit on the container.
425
+
- This setting is ignored if the [Per-object-heap hard limits](#per-object-heap-hard-limits) are configured.
429
426
430
427
|| Setting name | Values | Version introduced |
431
428
| - | - | - | - |
@@ -462,17 +459,11 @@ For more information about some of these settings, see the [Middle ground betwee
462
459
> [!TIP]
463
460
> If you're setting the option in *runtimeconfig.json*, specify a decimal value. If you're setting the option as an environment variable, specify a hexadecimal value. For example, to specify a heap hard limit of 200 mebibytes (MiB), the values would be 209715200 for the JSON file and 0xC800000 or C800000 for the environment variable.
464
461
465
-
### Heap limit percent
462
+
### Heap hard limit percent
466
463
467
-
- Specifies the allowable GC heap usage as a percentage of the total physical memory.
468
-
- If [System.GC.HeapHardLimit](#heap-limit) is also set, this setting is ignored.
464
+
- Specifies the heap hard limit as a percentage of the total physical memory. If the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, the total physical memory is the memory limit; otherwise it's what's available on the machine.
469
465
- This setting only applies to 64-bit computers.
470
-
- If the process is running inside a container that has a specified memory limit, the percentage is calculated as a percentage of that memory limit.
471
-
- This setting is ignored if the [Per-object-heap limits](#per-object-heap-limits) are configured.
472
-
- The default value, which only applies in certain cases, is the greater of 20 MB or 75% of the memory limit on the container. The default value applies if:
473
-
474
-
- The process is running inside a container that has a specified memory limit.
475
-
-[System.GC.HeapHardLimit](#heap-limit) is not set.
466
+
- This setting is ignored if the [Per-object-heap hard limits](#per-object-heap-hard-limits) are configured or the [heap hard limit](#heap-hard-limit) is configured.
476
467
477
468
|| Setting name | Values | Version introduced |
478
469
| - | - | - | - |
@@ -509,9 +500,9 @@ For more information about some of these settings, see the [Middle ground betwee
509
500
> [!TIP]
510
501
> If you're setting the option in *runtimeconfig.json*, specify a decimal value. If you're setting the option as an environment variable, specify a hexadecimal value. For example, to limit the heap usage to 30%, the values would be 30 for the JSON file and 0x1E or 1E for the environment variable.
511
502
512
-
### Per-object-heap limits
503
+
### Per-object-heap hard limits
513
504
514
-
You can specify the GC's allowable heap usage on a per-object-heap basis. The different heaps are the large object heap (LOH), small object heap (SOH), and pinned object heap (POH).
505
+
You can specify the GC's heap hard limit on a per-object-heap basis. The different heaps are the large object heap (LOH), small object heap (SOH), and pinned object heap (POH).
515
506
516
507
- If you specify a value for any of the `DOTNET_GCHeapHardLimitSOH`, `DOTNET_GCHeapHardLimitLOH`, or `DOTNET_GCHeapHardLimitPOH` settings, you must also specify a value for `DOTNET_GCHeapHardLimitSOH` and `DOTNET_GCHeapHardLimitLOH`. If you don't, the runtime will fail to initialize.
517
508
- The default value for `DOTNET_GCHeapHardLimitPOH` is 0. `DOTNET_GCHeapHardLimitSOH` and `DOTNET_GCHeapHardLimitLOH` don't have default values.
@@ -539,9 +530,9 @@ These configuration settings don't have specific MSBuild properties. However, yo
539
530
> [!TIP]
540
531
> If you're setting the option in *runtimeconfig.json*, specify a decimal value. If you're setting the option as an environment variable, specify a hexadecimal value. For example, to specify a heap hard limit of 200 mebibytes (MiB), the values would be 209715200 for the JSON file and 0xC800000 or C800000 for the environment variable.
541
532
542
-
### Per-object-heap limit percents
533
+
### Per-object-heap hard limit percents
543
534
544
-
You can specify the GC's allowable heap usage on a per-object-heap basis. The different heaps are the large object heap (LOH), small object heap (SOH), and pinned object heap (POH).
535
+
You can specify the GC's heap hard limit on a per-object-heap basis. The different heaps are the large object heap (LOH), small object heap (SOH), and pinned object heap (POH).
545
536
546
537
- If you specify a value for any of the `DOTNET_GCHeapHardLimitSOHPercent`, `DOTNET_GCHeapHardLimitLOHPercent`, or `DOTNET_GCHeapHardLimitPOHPercent` settings, you must also specify a value for `DOTNET_GCHeapHardLimitSOHPercent` and `DOTNET_GCHeapHardLimitLOHPercent`. If you don't, the runtime will fail to initialize.
547
538
- These settings are ignored if `DOTNET_GCHeapHardLimitSOH`, `DOTNET_GCHeapHardLimitLOH`, and `DOTNET_GCHeapHardLimitPOH` are specified.
Copy file name to clipboardExpand all lines: docs/standard/garbage-collection/fundamentals.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,7 +180,7 @@ A garbage collection has the following phases:
180
180
Ordinarily, the large object heap (LOH) isn't compacted because copying large objects imposes a performance penalty. However, in .NET Core and in .NET Framework 4.5.1 and later, you can use the <xref:System.Runtime.GCSettings.LargeObjectHeapCompactionMode%2A?displayProperty=nameWithType> property to compact the large object heap on demand. In addition, the LOH is automatically compacted when a hard limit is set by specifying either:
181
181
182
182
- A memory limit on a container.
183
-
- The [GCHeapHardLimit](../../core/runtime-config/garbage-collector.md#heap-limit) or [GCHeapHardLimitPercent](../../core/runtime-config/garbage-collector.md#heap-limit-percent) runtime configuration options.
183
+
- The [GCHeapHardLimit](../../core/runtime-config/garbage-collector.md#heap-hard-limit) or [GCHeapHardLimitPercent](../../core/runtime-config/garbage-collector.md#heap-hard-limit-percent) runtime configuration options.
184
184
185
185
The garbage collector uses the following information to determine whether objects are live:
0 commit comments