Skip to content

Remove unused languages from dev_langs #4450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/debugger/finding-memory-leaks-using-the-crt-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ title: "Find memory leaks with the CRT Library | Microsoft Docs"
ms.date: "10/04/2018"
ms.topic: "conceptual"
dev_langs:
- "CSharp"
- "VB"
- "FSharp"
- "C++"
helpviewer_keywords:
- "breakpoints, on memory allocation"
Expand Down Expand Up @@ -34,7 +31,7 @@ ms.workload:

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.

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

## Enable memory leak detection

Expand Down Expand Up @@ -210,7 +207,8 @@ _CrtSetBreakAlloc(18);
```
## Compare memory states
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.
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.

```cpp
_CrtMemState s1;
Expand Down Expand Up @@ -253,9 +251,11 @@ if ( _CrtMemDifference( &s3, &s1, &s2) )
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.
## False positives
`_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.
## See also
- [CRT debug heap details](../debugger/crt-debug-heap-details.md)
- [Debugger security](../debugger/debugger-security.md)
- [Debugging native code](../debugger/debugging-native-code.md)