Skip to content

Commit 513f332

Browse files
authored
fixed places related to heap hard limit configs (#42869)
1 parent 57dff72 commit 513f332

File tree

2 files changed

+16
-25
lines changed

2 files changed

+16
-25
lines changed

docs/core/runtime-config/garbage-collector.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,11 @@ Use the following settings to manage the garbage collector's memory and processo
218218
- [Affinitize ranges](#affinitize-ranges)
219219
- [CPU groups](#cpu-groups)
220220
- [Heap count](#heap-count)
221-
- [Heap limit](#heap-limit)
222-
- [Heap limit percent](#heap-limit-percent)
221+
- [Heap hard limit](#heap-hard-limit)
222+
- [Heap hard limit percent](#heap-hard-limit-percent)
223+
- [Per-object-heap hard limits](#per-object-heap-hard-limits)
224+
- [Per-object-heap hard limit percents](#per-object-heap-hard-limit-percents)
223225
- [High memory percent](#high-memory-percent)
224-
- [Per-object-heap limits](#per-object-heap-limits)
225-
- [Per-object-heap limit percents](#per-object-heap-limit-percents)
226226
- [Retain VM](#retain-vm)
227227

228228
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
417417
}
418418
```
419419

420-
### Heap limit
420+
### Heap hard limit
421421

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.
423423
- 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.
429426

430427
| | Setting name | Values | Version introduced |
431428
| - | - | - | - |
@@ -462,17 +459,11 @@ For more information about some of these settings, see the [Middle ground betwee
462459
> [!TIP]
463460
> 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.
464461
465-
### Heap limit percent
462+
### Heap hard limit percent
466463

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.
469465
- 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.
476467

477468
| | Setting name | Values | Version introduced |
478469
| - | - | - | - |
@@ -509,9 +500,9 @@ For more information about some of these settings, see the [Middle ground betwee
509500
> [!TIP]
510501
> 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.
511502
512-
### Per-object-heap limits
503+
### Per-object-heap hard limits
513504

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).
515506

516507
- 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.
517508
- 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
539530
> [!TIP]
540531
> 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.
541532
542-
### Per-object-heap limit percents
533+
### Per-object-heap hard limit percents
543534

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).
545536

546537
- 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.
547538
- These settings are ignored if `DOTNET_GCHeapHardLimitSOH`, `DOTNET_GCHeapHardLimitLOH`, and `DOTNET_GCHeapHardLimitPOH` are specified.

docs/standard/garbage-collection/fundamentals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ A garbage collection has the following phases:
180180
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:
181181

182182
- 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.
184184

185185
The garbage collector uses the following information to determine whether objects are live:
186186

0 commit comments

Comments
 (0)