Java Program Performance Optimizations-Overview

Source: Internet
Author: User
Tags server memory

Prefacethese two days in reading "Java Program performance optimization" This book, I learned the book Good Things to share to everyone. The person who has done the development should have encountered the performance problem more or less, encounter the performance problem how do you do? Can you read the performance of the program? This article tells you how to understand the performance and performance of the program reference indicators.
The ChaseHow the program performs:1. Speed of execution: whether the program reflects quickly and whether the response time is short enough. execution speed can be affected by many aspects, such as the problem of logical writing, query data size, network problems and so on.
2. Memory allocation: Whether the memory allocation is reasonable, excessive memory consumption or there is a leak. according to the running of the program and the size of the server memory allocation of memory, allocation is too small, easy to cause memory overflow, allocation is too large, easy to waste and cause the machine to run slower.
3. Start-up time: How long it will take for the program to run from normal to business. do not pre-load all things, appropriate use lazy loading mechanism, otherwise the user has not seen your program page has gone.
4. Load carrying Capacity: When the system pressure rises, the system's execution speed, response time of the rise curve is flat. you can use the relevant detection tools here to check load endurance.

Performance Reference indicators:1. Execution time: The time that a piece of code runs from the beginning to the end of the run. 2.CPU Time: The function or thread consumes CPU time. 3. Memory allocation: the memory space that the program occupies during runtime. 4. Disk throughput: Describes the usage of I/O. 5. Network throughput: Describes the use of the network. 6. Time: The time when the system responds to a user's behavior or event. The shorter the response time, the better the performance.
System Bottlenecksdue to the different characteristics of each application, the system bottleneck is different, but the computing resources of common system bottleneck are:
1. Disk I/O: Because disk I/O reads and writes more slowly than memory, disk I/O can become a bottleneck for the system if you wait for disk I/O to complete before doing anything else in the program.
2. Network operation: Due to the uncertainty of the network environment, if you want to read and write network data, it may be slower than disk I/O.
3.CPU: If the program is heavily consuming CPU resources for a long time, the contention for the CPU will cause performance problems, and the program needs to be rewritten to improve the situation.
4. Exception: For Java applications, exception capture and processing is very resource-intensive. If the exception is handled at a high frequency, performance can be significantly degraded.
5. Database: The general program is inseparable from the database, but if the massive data read and write operations will be time-consuming.
Summary:after understanding the basic concepts of performance, you will then continue to share about our usual Tiaoy

Java Program Performance Optimizations-Overview

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.