Cheng zhenlin, Fang Jinyun, Tang Zhimin(Institute of computing technology, Chinese Emy of Sciences, Beijing 100080, China)
Abstract: Most of the defects and errors of C ++-based software are related to memory, preventing, discovering, and eliminating memory-related defects in code, it becomes an important task for programmers to write, debug, and maintain code. This article is based on the engineering pract
Transferred from: http://www.cnblogs.com/taoxu0903/archive/2007/10/27/939261.htmlA memory leak is a common and frustrating problem for a C + + programmer. A number of techniques have been developed to address this problem, such as Smart pointer,garbage collection. Smart pointer technology is more mature, the STL already contains the class that supports smart pointer, but it doesn't seem to be widely used, and it doesn't solve all the problems; garbage
with Memory leakage is executed only once, or due to algorithm defects, there will always be one and only one piece of Memory leakage. For example, if the memory is allocated in a singleton constructor, the memory is not released in the destructor. The Singleton class only has one instance, So
1. Use of valgrind
Valgrind contains a core that provides a virtual CPUProgramThere are also a series of tools for debugging, profiling and similar tasks.Valgrind is designed to be non-intrusive and work directly on executable files, so you do not need to recompile, connect, and modify your program before checking.
Download:Valgrind Official Website: http://valgrind.org
To check for
[-]
Memory troubleshooting tools and related documents introduction focus
1 procsysvmmin_free_kbytes
2 procsysvmdrop_caches
3 Procsysrq-trigger
31 interpretation of the echo m Procsysrq-trigger output
4 Cat Procslabinfo
5 Cat Procmeminfo
51 Important Information
6 Top Information
7 Free Command
8 other files in the PRO
.
Enter the function for one-step execution.The step out function allows the code pointed to by the current arrow to run the program
Function return.Run to cursor enables the program to run to the code indicated by the cursor.1.5 view the use of the toolThe most important thing in the debugging process is to observe the state of the program during running so that we can find out
Program errors. The state here includes the value of each variable, the value in storage, and the value in
I. Introduction of LeakcanaryLeakcanary is a library of open-source detection memory leaks from square, which can easily integrate with your project and monitor memory leaks in the debug version of activity, fragment, etc.After the leakcanary is integrated into the project, a message is sent to the system notification bar when a memory leak is detected. Click to
Although JavaScript uses garbage collection for automatic memory management, effective (effective) memory management is still important. In this article we will explore memory issues in the analysis of JavaScript Web applications. When learning about features, be sure to try the relevant cases to improve your understanding of how these
The malloc subsystem monitoring tool Mallocdebug, included with Aix®version 5.3, can help you isolate memory leaks. Memory leaks are a tricky problem and are costly to handle, so it is important to use good tools to identify and understand the cause of the leak. The sample code provided in this article will show you a way to handle
Reprint: http://blog.csdn.net/aaa2832/article/details/194196791 How to troubleshoot memory leaksDalvik Debug Monitor Server (DDMS) is part of the ADT plug-in, where two features are available for memory checking:· Heap view the allocation of heaps· Allocation Tracker tracking Memory allocationsDDMS These two features help to find the operational behavior of a
Analysis of memory problems in Android Development (I) Tools
Memory leakage and memory overflow are common problems in Android development. How to quickly and effectively discover and track the source of Memory leakage or memory o
Label:Background: Production of a Redis server, physical memory 32G, several projects are in use, often less than a month memory will be exhausted, and then start to use Swap, when the swap is exhausted, the system will go down. The Redis configuration has also been optimized several times, but no results have been achieved. So I decided to look at the memory siz
vmstk
process stack size
vmexe
The virtual size of the executable memory of the program. It does not contain libraries used by processes
Vmlib
The size of the library used by the process
Example: Viewing The situation of the WebLogic process java The program code for the process is only 36k 96k 2712776k 92608 90 M vmlck indicates that no
1, Cat/proc/meminfoCat/proc/and cat/proc/ Get the memory information for a particular process; 2, Atop command is for use in the terminal environment based on ncurses interactive system and process monitoring tools. It shows a summary of dynamically updated system resources ( cpu , memory, network, input \ output, kernel), The high-load part of the syste
From http://www.linuxidc.com/Linux/2012-06/63754.htmValgrind is commonly used to analyze program performance and memory leak errors in programsA Valgrind toolset CompanyValgrind contains the following tools:1, Memcheck: Check the program of memory problems, such as leakage, cross-border, illegal pointers and so on.2, Callgrind: Check the program code run time and
how much memory is sent or retrieved from the swap system. The si column tells us how much memory is transferred from swap to real memory (In) per second ). The so column tells us how much memory is transferred from the real memory to the swap (Out) every second ).I/O
Io di
: Specifies the dynamic library to close. Is Dlopen (3) return value: not 0 error0Success Link with-LDL. Examples illustrate the use of dynamic loading.
Load the libpmath.so dynamic library file into memory and use the functions in the library. Code See DYNAMIC.C IV. Memory Management register cache memory hard disk Cloud Page table page box virtual
C + + language is the mainstream development language of desktop system, especially system software and large application software. The C + + language is known for its flexibility and is more complex. Using C + + to write robust code is more challenging. C + + allows dynamic memory management while also easily leading to more memory-related problems. In general, in addition to system design defects, C + + s
The C language as a standard programming language on Linux systems gives us great control over dynamic memory allocation. This freedom can lead to serious memory management problems that can cause a program to crash or cause performance degradation over time.A memory leak (that is malloc() , an internal call that is free() never freed after execution) and a buffe
) To hold Java classes, objects, and static members, all objects created in a Java program are allocated space in the heap, and the heap is used only to store objects. The application accesses the heap data through a reference that resides within the stack, and a JVM process can have only one heap. The JVM sets the initial and maximum values of the heap, respectively, with the-XMS and-XMX parameters.This diagram needs to focus on analyzing the current heap size, the maximum heap size, allocated
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.