In some high-concurrency programs, or a lot of memory for the calculation of the program, sometimes encountered some of the problems: The program just started to run very fast, and then run slowly down, even to a certain time there will be oom or StackOverflow and other errors. To understand the root causes of these errors, it is necessary to understand how the JVM divides, manages, and reclaims memory, and this blog will discuss these topics from the
encapsulated inside the object, and the data access is guaranteed to be atomic.It is recommended to use the volatile JavaBean model or to construct synchronous getter,setter.21, thread-restrictive makes it easier to construct thread-safe classes, because when the state of a class is limited, it is not necessary to examine the complete program when it parses its thread security.22, write concurrent programs, need more full comments, more complete docu
Java Open Source Practice 1--environment Configuration
Wuder
The software required for deploy under Window System:
The following software is executed under window
Jdk5.0
Download Address: http://java.sun.com/j2se/1.5.0/download.jsp
Jdk-1_5_0_01-windows-i586-p.exe
Jboss4.01
Download Address: http://prdownloads.sourceforge.net/jboss/
Jboss-4.0.1sp11.zip
Mysql4.1
Download Address: http://dev.mysql.c
of a negative number is a bitwise negation of its original code, except for the sign bit.Original code 10010 = anti-code 11101 (10010,1 number, it is negative)(11101) binary =-20 binaryThe complement notation stipulates that the complement of positive numbers is the same as the original code, and that the complement of negative numbers is added to the minus 1 of the inverse code.After-school Exercise 2:Java variables follow the "masking principle of
Snap to it and then how to deal with it?Many Java™ language methods, such as Thread.sleep() and Object.wait() , can be thrown InterruptedException . You cannot ignore this exception because it is a check exception (checked exception). But what should be done about it? In Java theory and practice this month, the concurrency expert Brian Goetz will explain Interrup
on a variable of a non- volatile type is long performed on a different thread, it is likely to read the high 32 bits of a value and the low 32 bits of the other value. Therefore, it is unsafe to use shared and variable 64-bit numeric variables in multithreaded programs, and there is no guarantee of minimum security. Unless we use keywords volatile to declare them, or to use locks to protect them.2.2 Plus lock and visibilityThe meaning of the lock is
The Java language provides flexible, seemingly simple threading capabilities that make it easy to use multithreading in your applications. However, concurrent programming in Java applications is more complex than it seems: in Java programs, there are subtle (and perhaps not subtle) ways to create data contention (race)
Many Java™ language methods, such as Thread.sleep() and Object.wait() , can be thrown InterruptedException . You cannot ignore this exception because it is a check exception (checked exception). But what should be done about it? In Java theory and practice this month, the concurrency expert Brian Goetz will explain Interruptedexception's meaning, why it throws in
Final keywords are often misused-they are used excessively when declaring classes and methods, but are not used enough when declaring instance fields. This month, Java practitioner Brian Goetz explored some useful
final.
Like in its cousin-CconstThe same keyword, according to the context,finalIt indicates different things.finalKeywords can be applied to classes, methods, or fields. When applied to a class, it means that the class can no longer genera
The new lock class improves synchronicity--but it can't be abandoned right now. SynchronizedJDK 5.0 provides a number of new and effective options for developers to develop high-performance concurrent applications. For example, a java.util.concurrent.lock class in the ReentrantLock Java language is synchronized replaced with the same memory semantics, the same lock, but with better performance under race conditions, and there are synchronized other fe
Introduction to Java NIO (iii) from theory to practice: using NIO to read and writeGuibin.beijing@gmail.com
OverviewReading and writing are the most basic IO processing. Reading from a Channel is very simple. We only need to create a Buffer and then require the Channel to read data to the Buffer. Writing is also very simple. You also need to create a Buffer to fill the data to be written into the Buffer, an
The Kafka cluster (pseudo distributed) is already deployed, and the following is built into the Java development environment.
I. Environmental description
1, Win10 Eclipse (Kepler)
2, the machine set up a virtual machine system: CentOS 6.5 ip:192.168.136.134
3, deployed on the 134 zookeeper pseudo distributed deployment 192.168.136.134:2181,192.168.136.134:2182,192.168.136.134:2183
4. Deployment of the Kafka broker Cluster (pseudo distributed Deployme
goal of zookeeper is to encapsulate complex and error-prone services that provide users with easy-to-use interfaces and performance-efficient, robust systems. Ten. Sqoop Sqoop is a tool used to transfer data from Hadoop and relational databases to and from a relational database to HDFs in Hadoop, or to the data in HDFs into a relational database. Oozie. Apache Oozie is a scalable, reliable, and extensible workflow Scheduling system for managing Hadoop jobs. The Oozie workflow job is an active
Many programmers do not use fixed-point or floating-point numbers throughout their development careers, with the possible exception being used occasionally in timing tests or benchmarking programs. The Java language and class libraries support two types of ―ieee 754 floating-point (float and double, wrapper class (wrapper class) for float and double), and arbitrary-precision decimals (java.math.BigDecimal).
reliability for LANs. For example, the video conferencing system, does not require audio and video data is absolutely correct, as long as the consistency can be guaranteed, in this case, it is obvious that using UDP is more reasonable.third, what is the socketSockets are also commonly referred to as "sockets," which describe IP addresses and ports, and are a handle to a communication chain. The two programs on the network realize the exchange of data
named, which expungeStaleEntries() Map is called in most operations, which removes all invalid references in the reference queue and deletes the associated mappings. expungeStaleEntries()a possible implementation is shown in Listing 7. The type used to store the key-value mappings is Entry extended WeakReference , so when the expungeStaleEntries() next invalid weak reference is requested, it gets one Entry . It is more efficient to use a reference queue instead of a regular scan of the content,
more high-level code on the call stack needs to process the interrupt after the irrevocable task ends. Listing 6 shows a method that waits for a blocking queue until an available item appears in the queue, regardless of whether it is interrupted or not. For the convenience of others, it restores the interrupt state in a finally block after it has ended, lest it deprive the caller of the interrupt request of the right. (It cannot restore the interrupt state at an earlier time, because that will
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.