When it is known that a problem is caused by a memory leak, the problem is simple, the difficulty lies in the early identification work. A platform responsible for the international roaming business processing, the main business process is AMMs, running on the JVM, the problem starts with the following phenomenon:1, the CPU of the AMMS process is abnormal, in the
, the new host is not considered during message sending, as shown in the figure below:
After B sends a message to a, host a is designed to distribute messages to all its extensions (B, c, d, therefore, another group of message host D is also considered to be the extension of A. The message of B is propagated to D. After receiving the message, d checks its extension (E, F, ),
After sending this message back to a (Step 3), A and D will continuously forward messages whose source is B, resulting in
GC.As you can see from Figure 2, the objects of the Java.util.HashMap class occupy a lot of space.Dominator Tree 3:As you can see from Figure 3, Com.csii.ibs.lc.ClusterOnlineUserRegistry takes up a lot of memory spaceTop comsumers 4:Shows what the largest objects in memory are, what their corresponding classes are, and what class loaders are classloader. There are times where we can see where the code leak
means a survivor area consumes 1/8 of Eden memory, or 1/10 of the Cenozoic memory) PermSize = 268435456 (256.0MB) # #perm区大小 MaxPermSize = 268435456 (256.0MB) # #最大可分配perm区大小Heap Usage: # #堆使用情况New Generation (eden + 1 Survivor space): # #新生代 (Eden District + survior) capacity = 322109440 (307.1875MB) # #新生代容量307M used = 226237024 (215.75643920898438MB) # #已经使用大小215M f
How to judge the object's "death" and "live" in the article, how to judge the existence of the object, in which the root search algorithm, and the GC roots have access to determine the object's life and Death attribute. So, what is the reason that the Java virtual machine sends the memory leak, has the following two main features:
(1) The Assigned object is accessible, that is, in the roots graph, there is
Memory Overflow (OOM): a situation in which running memory is larger than available memory. For example, the application of an integer space, the result is stored only a long to store the data memory leak (memory
1. What is a memory leak?Memory leak refers to the dynamic application of memory in the program after use, no release, resulting in this part of the memory is not reclaimed by the system, over time, may cause the program
Common memory leak lookup methods see: http://hukai.me/android-performance-patterns/This article is an example of Google's release of the Android performance optimization paradigm, which provides a good demonstration of rendering, memory GC, and power consumption.Here I summarize the following, common memory leaks in A
What is the memory leak in the program?
We have written many programs with the keyword Free (). For example, I am in this post about some of the important operations of the list (Important operations on a Linked list) to delete the entire list of this function, the code snippet is as follows:struct node * deletelist (struct node * head) { struct node * temp; while (Head! = NULL) { =
[Android] [Memory Leak] Inputmethodmanager memory leak phenomenon and its solutionphenomena : on the k_touch_v9 model of a particular model , an interface appears Inputmethodmanager hold a Activity, causes the Activity cannot be recycled . if the Activity be opened again , then the old ones will be released. , but the
JVM interpretation (III): JVM memory region, interpretation of jvm memory region
The full name of JVM is java Virtual Machine (java Virtual Machine). JVM shields software and hardware
when we use C + + to do the underlying driver, often encounter memory shortage warning, the reason is often because of memory overflow, leakage or cross-border reasons. So what's the connection between them? memory overflow (out of Memories)means that the program does not have enough memory space for it to use when it
Summary
Although the Java Virtual Machine (JVM) and its garbage collector (garbage COLLECTOR,GC) are responsible for managing most of the memory tasks, a memory leak may still occur in the Java software program. In fact, this is a common problem in large projects. The first step in avoiding a
Original: https://vld.codeplex.com/Visual Leak Detector is a memory leak detection tool dedicated to Visual C + +, which is free, open source, and highly robust.VLD is easy to use:1. After installing VLD, just tell Visual C + + where to find its header files and libraries. (: https://vld.codeplex.com)2. You can then use VLD by adding the following line of code to
subclass's destructor?Because the premise of polymorphism is virtual function.Under normal circumstances, the destructor of a class should be written as a virtual function, which, if forgotten, could cause a memory leak.(2) A space for an array is applied, but only the space of the first element is releasedclassnewclass[5];delete pA;Not all of these situations can lead to
. the only exception is stdafx. H (or any other precompiled header ). a precompiled header, such as stdafx. h, must always be the first header encoded in a source file, so VLD. h must be encoded ded after any precompiled headers.2. if your program contains one or more DLLs that you wowould also like to check for memory leaks, then also include VLD. h in at least one source file from each DLL to be removed ded in l
, allocating memory in the class's constructor does not release the memory in the destructor, so a memory leak occurs only once.4) An implicit memory leak. The program keeps allocating memory
I haven't worked on Java for more than a year. I recently studied hadoop, so I want to repeat java. In the past, I mainly focused on Java syntax and APIs, and seldom focused on the underlying memory, so now I am looking for time to pick it up.
JVM, full name: Java virtual machine, that is, the Java Virtual Machine. Specifically, JVM can be regarded as an imaginar
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.