Skip to content

Commit f46e01a

Browse files
Maoni0Ron Petrusha
authored and
Ron Petrusha
committed
added more detail for this bug (microsoft#806)
* added more detail for this bug * Minor grammatical and punctuation changes.
1 parent 98f6372 commit f46e01a

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

releases/net471/KnownIssues/470006-GC Crashes with high rate of large object allocation.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,42 @@
22

33
## Symptoms
44

5-
When background GC is enabled, an application running on .NET Framework 4.7.1 experiences
5+
When background GC (BGC) is enabled, an application running on .NET Framework 4.7.1 experiences
66
intermittent crashes that did not occur when running on other .NET Framework versions.
77

88
## Cause
99

10-
.NET Framework 4.7.1 includes changes that improve background GC performance.
11-
Because of these changes, a rare combination of factors can cause the background GC
12-
to reclaim a large object while the program is still using it.
10+
.NET Framework 4.7.1 includes changes that improve background GC performance. It allows large object allocations during part of the BGC sweep phase, and the large objects allocated during this time must be marked correctly in the allocator or they will be erroneously reclaimed. A GC can be triggered during the large object allocator code path, and if the following happens, this bug will be triggered:
11+
12+
- This is a BGC.
13+
14+
- The range for BGC changed from the previous range (ie, a new segment is allocated outside of the previous range).
15+
16+
- The new large object is in the region that didn't exist in the previous range.
17+
18+
- The new large object did its marking during the BGC sweep phase.
19+
20+
This set of conditions make this bug very rare.
21+
22+
Since GC doesn't shrink the range, it means this bug usually is only seen very early on during a process or when you suddenly allocate more large objects than before, which requires acquiring a new segment that's outside the heap range.
23+
1324

1425
## Impact
1526

1627
This problem impacts applications that run with the background GC enabled and that also allocate
1728
and free large objects at a high rate. As described in the article [Fundamentals of Garbage Collection](https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals#the-managed-heap),
1829
a large object is any object that is 85,000 bytes or larger in size.
1930

20-
This problem is rare, and is more likely to occur when running on the x86 version of the
21-
.NET Framework than when running on the x64 version of the 4.7.1 .NET Framework.
31+
This problem is rare and is more likely to occur when running on the x86 version of the
32+
.NET Framework 4.7.1 than when running on the x64 version of the .NET Framework 4.7.1.
2233

2334
## Workarounds
2435

25-
The most practical workaround is to disable the background GC by setting the enabled attribute of the [<gcConcurrent> element](https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/gcconcurrent-element) in the
26-
<runtime> section of your application configuration file to false.
36+
The most practical workaround is to disable background GC by setting the `enabled` attribute of the [<gcConcurrent> element](https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtimea/gcconcurrent-element) in the
37+
<runtime> section of your application configuration file to `false`.
2738

2839
The only other workaround is to change the application to allocate and free large objects
29-
at a much lower rate.
40+
at a much lower rate. However, note that this workaround doesn't provide a guarantee; it just makes the chance of this bug happening smaller.
3041

3142
## Resolution
3243

0 commit comments

Comments
 (0)