Sunday, October 7, 2012

Different Types of Memory


Memory
1.    The Memory relates to the many devices and components that are responsible for storing data and applications on a temporary or a permanent basis. It enables a person to retain the information that is stored on the computer. Without it, the processor would not be able to find a place which is needed to store the calculations and processes
2.    Memory is used to hold portions of the operating system, application programs and data that are currently being used by the CPU (central processing unit) or that are likely to be used by it. This includes the kernel, which is the core of the operating system and the first part of it to be loaded into memory during booting (i.e., the process by which a computer starts and automatically loads the operating system into memory) and which remains there for the entire duration of a computer session
Types of Computer Memory:
Ø  Computer RAM:
Computer RAM
is the best known form of memory your computer uses. Every file or application opened is placed in RAM. Any information the computer needs or uses becomes part of a continuous cycle where the CPU requests data from RAM, processes it and then writes new data back to RAM. This can happen millions of times a second. However, this is usually just for temporary file storage, so unless the data is saved somewhere, it is deleted when the files or applications are closed.
Ø  Hard Drive:
A Hard Drive is a form of computer memory that allows you to permanently store data. This is where all of your permanent files and programs are stored. On computers running with Microsoft windows the Hard Drive is often called C-Drive. The size of a Hard Drive is typically measured in gigabytes.
Ø  Virtual Memory:
Virtual memory typically comes into place when applications are too large for the RAM to handle. The operating System uses the hard drive to temporarily store information and take it back when needed. This is normally a lot slower than actual RAM and can possibly degrade performance if used to heavily.
Ø  Cache Memory:
Cache Memory is used in-between the CPU and the RAM and holds the most frequently used data or instructions to be processed.

Virtual memory is a system where all physical memory is controlled by the operating system. When a program needs memory, it requests it from the operating system. The operating system then decides what physical location to place the memory in.

Random Access Memory (RAM)
RAM is a location within the computer system which is responsible for stacking away data on a temporary basis, so that it can be promptly accessed by the processor. The information stored in RAM is typically loaded from the computer's hard disk, and includes data related to the operating system and certain applications. When the system is switched off, RAM loses all the stored information. The data remains stored and can be retained only when the system is running.

When the RAM gets full, the computer system is more likely to operate at a slow speed. The data can be retrieved in any random order. Generally, there are two types of RAM; namely Static RAM (SRAM) and Dynamic RAM (DRAM). When many programs are running on the computer simultaneously, the virtual memory allows the computer to search in RAM for memory portions which haven't been utilized lately and copy them onto the hard drive. This action frees up RAM space and enables the system to load different programs.
 
·         Programmable read-only memory (PROM) is a type of ROM into which a program or other data can be written once after it leaves the factory, usually by the manufacturer of the computer (or of any other product in which it is used). It cannot subsequently be erased and rewritten.
·         Erasable programmable read-only memory (EPROM) is a type of PROM whose contents can be erased by exposing the chip's upper surface to ultraviolet light. The contents can then be rewritten electronically.
·         Electrically erasable programmable read-only memory (EEPROM) is a type of PROM whose contents can be erased through the use of electronic signals. This is much more convenient than using ultraviolet light.
·         Flash memory is a type of EEPROM that is used in USB flash drives (also called key drives),
an increasingly popular kind of removable storage device.

Read Only Memory (ROM)
This type of memory is active, regardless of whether the system is turned on or is switched off. It is a kind of permanent non-volatile storage memory. As the name 'read only' suggests, the contents in it cannot be changed or modified. It is an integrated circuit which is pre-programmed with important data that should necessarily be present for the computer to carry out its normal functionalities.

Heap memory
A heap memory pool is an internal memory pool created at start-up that tasks use to dynamically allocate memory as needed

Saturday, March 31, 2012

Sunday, March 25, 2012

How to find out performance issues from resource level

1) Memory based

a. Pages/sec > 10
b. Page Faults/sec > Cache Faults/sec AND Committed Bytes is more than Physical Memory

2) Processor based
a. If system: % Total Processor Time averages near 100% & system:
Processor Queue Length averages more than 2. (Run for at least 2 hours)

Performance Counters

Client Side Statistics

•Running Vusers

•Hits per Second

•Throughput

•HTTP Status Code

•HTTP responses per Second

•Pages downloaded per Second

•Transaction response time

•Page Component breakdown time

•Page Download time

•Component size Analysis

•Error Statistics

•Errors per Second

•Total Successful/Failed Transactions

Server Side Statistics

•System Resources

–CPU, Memory, Disk I/O

•Web Server Resources

–Threads, Cache Hit Ratio

•Application Server Resources

–Heap size, JDBC Connection Pool

•Database Server Resources

–Wait Events, SQL Queries

•Transaction Profiling

- Code Block Analysis

Network Monitoring

•Bandwidth Utilization

•Network delay time

•Network Segment delay time

Do's and Don'ts in Load Testing

Do’s :

Ø Providing admin rights and start up health check on the servers for monitoring before ten minutes.

Ø Schedule a dedicated time frame and environment for the load test.

Ø Clearing all the logs and stopping unnecessary Processes.

Ø Creating a checklist on environment and application changes.

Ø Creating folders for results, test scripts and test runs on the test runs executed.

Ø Conducting Baseline tests before and after tuning.

Ø Restarting the application after each successful run.

DON’Ts:

Ø Browsing through the application during load testing.

Ø Start of any activity (Virus Scan)

Ø Opening the monitoring tools during load testing.

Ø Changing configuration settings of application server or database server during load testing.

Ø Connecting to remote machine from either the load machine or the controller machine.

Ø Execute batch processes during the test

Ø Usage of network during the test.


Sunday, January 8, 2012

Common bottlenecks in J2EE applications

Enterprise applications written in the Java language involve complex object relationships and utilize
large numbers of objects. Although, the Java language automatically manages memory associated
with object life cycles, understanding the application usage patterns for objects is important. In
particular, verify the following:

• The application is not over-utilizing objects
• The application is not leaking objects
• The Java heap parameters are set properly to handle a given object usage pattern

The garbage collection bottleneck
Examining Java garbage collection gives insight to how the application is utilizing memory.

The garbage collection gauge
You can use garbage collection to evaluate application performance health. By monitoring garbage
collection during the execution of a fixed workload, you gain insight as to whether the application is
over-utilizing objects. Garbage collection can even detect the presence of memory leaks.

Detecting over-utilization of objects
You can check if the application is overusing objects, by observing the counters for the JVM runtime.
By increasing the heap size, you can reduce the number of garbage collection cycles and thereby
reduce the total cost of GC.
If you can not optimize the application, increasing the size of your Java heap may help.

Detecting memory leaks
Memory leaks are more damaging than memory overuse, because a memory leak ultimately leads to
system instability. Over time, garbage collection occurs more frequently until the heap is exhausted
If the free heap continuously declines over time, this may indicate a memory leak.

Memory Leak Testing
The goal of memory leak testing is to magnify numbers.

• Long-running test
Memory leak problems can manifest only after a period of time, therefore, memory leaks are
found easily during long-running tests.

• Repetitive test
In many cases, memory leak problems occur by successive repetitions of the same test case.
The goal of memory leak testing is to establish a big gap between unusable memory and used
memory in terms of their relative sizes.

• Concurrency test
Some memory leak problems can occur only when there are several threads running in the
application. Unfortunately, synchronization points are very susceptible to memory leaks
because of the added complication in the program logic. Careless programming can lead to
kept or unreleased references. The incident of memory leaks is often facilitated or accelerated
by increased concurrency in the system. The most common way to increase concurrency is to
increase the number of clients in the test bed

Java heap parameters
The Java heap parameters also influence the behavior of garbage collection. Increasing the
heap size supports more object creation. Because a large heap takes longer to fill, the
application runs longer before a garbage collection occurs.

Compare the following statistics:
• Number of garbage collection calls.
• Average duration of a single garbage collection call.
• Ratio between the length of a single garbage collection call and the average time between
calls. This can be viewed as the percentage of time spent doing GC processing.
• System paging activity.

Formula to calculate server throughput

. Server Thruput = # of real simultaneous users / ( Average Response Time + Think Time )