Skip to content

Commit c1fdee5

Browse files
authored
Merge pull request #4450 from Youssef1313/patch-1
Remove unused languages from dev_langs
2 parents 09b2239 + 6b4153e commit c1fdee5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/debugger/finding-memory-leaks-using-the-crt-library.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ title: "Find memory leaks with the CRT Library | Microsoft Docs"
33
ms.date: "10/04/2018"
44
ms.topic: "conceptual"
55
dev_langs:
6-
- "CSharp"
7-
- "VB"
8-
- "FSharp"
96
- "C++"
107
helpviewer_keywords:
118
- "breakpoints, on memory allocation"
@@ -34,7 +31,7 @@ ms.workload:
3431

3532
Memory leaks are among the most subtle and hard-to-detect bugs in C/C++ apps. Memory leaks result from the failure to correctly deallocate memory that was previously allocated. A small memory leak might not be noticed at first, but over time can cause symptoms ranging from poor performance to crashing when the app runs out of memory. A leaking app that uses up all available memory can cause other apps to crash, creating confusion as to which app is responsible. Even harmless memory leaks might indicate other problems that should be corrected.
3633

37-
The [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] debugger and C Run-time Library (CRT) can help you detect and identify memory leaks.
34+
The [!INCLUDE[vsprvs](../code-quality/includes/vsprvs_md.md)] debugger and C Run-time Library (CRT) can help you detect and identify memory leaks.
3835

3936
## Enable memory leak detection
4037

@@ -210,7 +207,8 @@ _CrtSetBreakAlloc(18);
210207
```
211208
212209
## Compare memory states
213-
Another technique for locating memory leaks involves taking snapshots of the application's memory state at key points. To take a snapshot of the memory state at a given point in your application, create a `_CrtMemState` structure and pass it to the `_CrtMemCheckpoint` function.
210+
211+
Another technique for locating memory leaks involves taking snapshots of the application's memory state at key points. To take a snapshot of the memory state at a given point in your application, create a `_CrtMemState` structure and pass it to the `_CrtMemCheckpoint` function.
214212

215213
```cpp
216214
_CrtMemState s1;
@@ -253,9 +251,11 @@ if ( _CrtMemDifference( &s3, &s1, &s2) )
253251
One technique for finding memory leaks begins by placing `_CrtMemCheckpoint` calls at the beginning and end of your app, then using `_CrtMemDifference` to compare the results. If `_CrtMemDifference` shows a memory leak, you can add more `_CrtMemCheckpoint` calls to divide your program using a binary search, until you've isolated the source of the leak.
254252
255253
## False positives
254+
256255
`_CrtDumpMemoryLeaks` can give false indications of memory leaks if a library marks internal allocations as normal blocks instead of CRT blocks or client blocks. In that case, `_CrtDumpMemoryLeaks` is unable to tell the difference between user allocations and internal library allocations. If the global destructors for the library allocations run after the point where you call `_CrtDumpMemoryLeaks`, every internal library allocation is reported as a memory leak. Versions of the Standard Template Library earlier than Visual Studio .NET may cause `_CrtDumpMemoryLeaks` to report such false positives.
257256
258257
## See also
258+
259259
- [CRT debug heap details](../debugger/crt-debug-heap-details.md)
260260
- [Debugger security](../debugger/debugger-security.md)
261261
- [Debugging native code](../debugger/debugging-native-code.md)

0 commit comments

Comments
 (0)