Skip to content

Commit ee42623

Browse files
authored
Merge pull request #8478 from MicrosoftDocs/main637989807062485099sync_temp
Repo sync for protected CLA branch
2 parents 5dfe95d + e67072b commit ee42623

File tree

4 files changed

+64
-2
lines changed

4 files changed

+64
-2
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Perf insights for excessive induced GCs
3+
description: Learn how to improve performance for excessive induced garbage collections
4+
ms.date: 9/15/2022
5+
ms.topic: reference
6+
author: mikejo5000
7+
ms.author: mikejo
8+
manager: jmartens
9+
ms.technology: vs-ide-debug
10+
ms.workload:
11+
- multiple
12+
---
13+
14+
# Excessive induced GCs
15+
16+
This article describes performance insights for excessive induced garbage collections (GCs).
17+
18+
## Cause
19+
20+
It's rarely justified inducing GCs because the garbage collector manages its own schedule. The only rare cases are mostly from the framework, but even that should be very rare. If you're seeing too many induced GCs, it's something to investigate, especially if you're worried about your GC time or if you're surprised by the fact there are induced GCs.
21+
22+
## Rule description
23+
24+
The [.NET Garbage Collector (GC)](/dotnet/standard/garbage-collection/) can determine the best time to perform a collection in most cases.
25+
26+
When an application frequently forces GC collections, it might impact performance and responsiveness of an application.
27+
28+
## How to investigate a warning
29+
30+
Look for <xref:System.GC.Collect%2A> and check whether the method calls are really needed.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Perf insights for high LOH fragmentation
3+
description: Learn how to improve performance for high large object heap (LOH) fragmentation
4+
ms.date: 9/15/2022
5+
ms.topic: reference
6+
author: mikejo5000
7+
ms.author: mikejo
8+
manager: jmartens
9+
ms.technology: vs-ide-debug
10+
ms.workload:
11+
- multiple
12+
---
13+
14+
# High LOH Fragmentation
15+
16+
This article describes performance insights for high large object heap (LOH) allocations.
17+
18+
## Cause
19+
20+
The [large object heap (LOH)](/dotnet/standard/garbage-collection/large-object-heap) is not compacted and the fragmentation is used to satisfy LOH allocation requests. Consider reducing temporary large object allocations through reuse or pooling to avoid triggering frequent Gen2 GCs.
21+
22+
## Rule description
23+
24+
The [.NET Garbage Collector (GC)](/dotnet/standard/garbage-collection/) puts large objects in a specific region of memory known as the [large object heap (LOH)](/dotnet/standard/garbage-collection/large-object-heap). Because the LOH is not compacted, sometimes the LOH can be the source of fragmentation.
25+
26+
## How to investigate a warning
27+
28+
Click the **Investigate** link to go to the [Allocation](../profiling/dotnet-alloc-tool.md#allocation) view showing allocations grouped by heap type. Objects under the Large Object Heap node are contributing to the frequent GCs. Consider reducing these allocations through reuse or pooling techniques.

docs/profiling/perf-insights-loh-allocations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ Frequent temporary LOH object allocations force unproductive full generation 2 (
2323

2424
The [.NET Garbage Collector (GC)](/dotnet/standard/garbage-collection/) puts large objects in a specific region of memory known as the [large object heap (LOH)](/dotnet/standard/garbage-collection/large-object-heap). These allocations are assumed to survive longer due to their allocation cost and are therefore only collected during full [Gen2 GCs](/dotnet/standard/garbage-collection/fundamentals#generations).
2525

26-
When this assumption is not true and an application frequently allocates temporary large objects, the LOH space is quickly used up. This causes many Gen2 GCs to regain space which can impact performance and responsiveness of an application.
26+
When this assumption isn't true, and an application frequently allocates temporary large objects, the LOH space is quickly used up. This causes many Gen2 GCs to regain space which can impact performance and responsiveness of an application.
2727

2828
## How to investigate a warning
2929

30-
Clicking on the "investigate" link will take you to the [Allocation](../profiling/dotnet-alloc-tool.md?#allocation) view showing allocations grouped by heap type. Objects under the Large Object Heap node are contributing to the frequent GCs, consider reducing these allocations through reuse or pooling techniques.
30+
Click the **Investigate** link to go to the [Allocation](../profiling/dotnet-alloc-tool.md#allocation) view showing allocations grouped by heap type. Objects under the Large Object Heap node are contributing to the frequent GCs. Consider reducing these allocations through reuse or pooling techniques.

docs/profiling/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
items:
5959
- name: LOH allocations
6060
href: perf-insights-loh-allocations.md
61+
- name: Excessive induced GCs
62+
href: perf-insights-excessive-induced-gcs.md
63+
- name: High LOH fragmentation
64+
href: perf-insights-high-loh-fragmentation.md
6165
- name: Analyze memory usage without the debugger
6266
href: memory-usage-without-debugging2.md
6367
- name: Custom native ETW heap events

0 commit comments

Comments
 (0)