How to use Jconsole to observe and analyze the operation of Java program, and to perform debugging and tuninghttp://jiajun.iteye.com/blog/810150How to use JVISUALVM for performance analysishttp://jiajun.iteye.com/blog/1180230Full-featured Java Profiling tool (Profiler)Http://www.blogjava.net/mrzhangshunli/archive/2007/08/27/140088.htmlHttp://www.cnblogs.com/jayzee/p/3184087.htmlVisualVM Getting Started Guid
Some time ago in the performance analysis of the company's projects, from a simple analysis of log (GC log, postgrep log, Hibernate statitistic), through the AOP to collect software running data, to pet testing, feel time spent a lot, performance also has a certain increase, But it always feels like working in primitive times, unable to be simple and smooth, and to achieve the desired result with great clar
Detailed analysis of heap and stack in Java
To sum up the first sentence: When the Java language uses memory, the stack memory mainly stores the following content: Basic Data Types and object references, while the heap memory stores objects, stack memory is faster than heap memory. In summary, the object is referenced in the stack and the object is in the stack.
In programming languages, we are exposed to enum types, and we usually have poor enumerations to implement some limitations. Java is no exception. The enumeration type in Java is enum, and this article provides some more in-depth analysis of enumerations.What is an enumEnum is an attribute introduced from Java 5 to fac
Below is a list of some tools that can help you examine your Java source code for potential problems:
1. pMD from http://pmd.sourceforge.net/
License: PMD is licensed under a "BSD-style" License
PMD scans Java source code and looks for potential problems like:
* Possible bugs-Empty try/catch/finally/switch statements* Dead Code-unused local variables, parameters and private methods* Suboptimal code-
represent the Klass as the lock object in the inner object of the JVM. (Excerpt from: http://www.cnblogs.com/javaminer/p/3889023.html)
Let's continue with the analysis, but before we go any further we need to understand two important concepts: Java object header, Monitor. Java object headers, monitor
Java object Heade
My understanding of java String and source code analysis, javastring
Abstract: Original Source: http://www.cnblogs.com/Alandre/ sediment tile pulp carpenter hope to reprint, retain abstract, thank you!Get up every day and tell yourself that your goal is "technology + English and Life"! -Sand, brick, and tile pulp carpenter
1. char is a String
Ii. String recognition and source code analysis1. char is a Strin
ClassLoader, for example,I want to load a Wswordmanager class, the system will first look in the cache, if not found, then call the parent loader to the correspondingThe path inside to look for, has been upward, looked for the load, if cannot find to report the ClassNotFound exception.----------------------------------------a gorgeous delimiter----------------------------------------Haha, a day-long trial can prove this.When resolving the System project "native class repeated load, exception is
Java Collection source code analysis (2) ArrayList, javaarraylistArrayList Overview
ArrayList is implemented based on arrays. It is a dynamic array with its capacity Automatically increasing. It is similar to dynamic memory application in C language and dynamic memory growth.
ArrayList is NOT thread-safe and can only be used in a single-threaded environment. Collections can be used in a multi-threaded envir
Java Exception Handling analysis (Part 1)An exception
Exceptions are some errors in the program, but not all errors are exceptions, and sometimes they can be avoided. For example, you have less code
A semicolon (;) indicates that java. lang. Error is returned. If you use System. out. println (11/0 ),
If the divisor is set to 0, a
Objective:
Recently in the analysis of Hadoop RPC (remote Procedure call Protocol, the remoting protocol, which is a protocol that requests services over a network from a remote computer program without the need to understand the underlying network technology). can refer to: http://baike.baidu.com/view/32726.htm mechanism, found that the RPC mechanism of HADOOP implementation of the main use of two technologies: Dynamic agents (dynamic agents can ref
, we need to troubleshoot on the server. Use the Jmap tool that comes with the JDK to see what the specific objects are in the JAVA application, as well as the number of cases and their size. The specific commands are as follows:Jmap-histo:live ' pid of Java ' # for easy observation, or write output to file Jmap-histo:live ' pid of Java ' >/tmp/jmap00After observ
1:GC Log OutputAdd-xx:+printgc-xx:+printgcdetails-xx:+printgctimestamps-xx:+printgcapplicationstopedtime to the JVM startup parameters, The JVM will output GC profile, details, GC time information, and application pause times caused by GC in these parameter sequences. If you add the parameter-XLOGGC: file path After the parameter, the GC information will be output to the specified file. Other parameters are-VERBOSE:GC and-xx:+printtenuringdistribution and so on.2:jconsoleJconsole is a memory
permanent area for storing immutable objects such as classes, methods, strings, and so on.Note: There are no permgen in java8, such as intern strings, which have been moved to the normal heap in Java 7.Java garbage Collection sub-level, 0-level for all garbage collection, will be reclaimed in the old field of garbage, Level 1 or above is a partial garbage collection, only the garbage collected in young, me
changes to UTF-8 saved "trickle PO ③.java is stored as UTF-8 (with BOM) and cannot be compiled.
. java file Character set
. class file Character set
GBK
UTF-8
UTF-8 (no BOM)
UTF-8 (but Chinese is garbled)
UTF-8 (with BOM)
Compilation failed unable to build. class file
For the second case above, why does the. class k
to understand, and it's just a basic understanding of it. Volatile is slightly lighter than synchronized, and in some cases it can replace synchronized, but it does not completely replace synchronized, which can only be used on certain occasions. Use it must meet the following two conditions:
The write operation of the variable does not depend on the current value;
The variable is not contained in an invariant that has other variables.
Volatile is often used in two o
Analysis of Java NULL pointer exceptions (1)
The Java language has an "exception mechanism" to handle special cases in the program. For example, if the divisor is zero, it is an "exception ".The NULL pointer exception java. Lang. nullpointerexception is a common exception. Let's talk about its
Performance to:
The scalability of the IO API is of great importance to Web applications. In the previous API for Java version 1.4, blocking I/O was disappointing to many people. Starting with the J2SE 1.4 version, Java finally has a scalable I/O API. This paper analyzes and calculates the variability of the new and old I/O APIs in terms of scalability.
Outline:
I. Overview
Ii. HTTP servers written with
Analysis on the factory mode of JAVA design mode (III)
Before reading this article, read the simple factory mode and factory method mode in (1) and (2.1 abstract factory model Introduction
Abstract Factory mode: Toolkit mode ). Abstract Factory mode is the most abstract and general factory mode in all forms, such.
Fig 1.1
There is A factory class level structure on the left, and two different product le
JVM Memory Structure
Heap: All object instances or arrays allocate memory on the Java heap, and the heap size is regulated by-xmx and-XMS;
Method Area: Storing information about virtual machine load classes, such as class static variables and constants; (part of a heap, a permanent area in a heap)
Stack: Stores the local variables table, operations, method exits, and other information related to method execution when the thread calls the method.
In
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.