Showing posts with label Memory Issues. Show all posts
Showing posts with label Memory Issues. Show all posts

Friday, June 7, 2013

What is a page fault?

An interrupt that occurs when a program requests data that is not currently in real memory. The interrupt triggers the operating system to fetch the data from a virtual memory and load it into RAM.

An invalid page fault or page fault error occurs when the operating system cannot find the data in virtual memory. This usually happens when the virtual memory area, or the table that maps virtual addresses to real addresses, becomes corrupt.


The read/write speed of a hard drive is much slower than RAM, and the technology of a hard drive is not geared toward accessing small pieces of data at a time. If your system has to rely too heavily on virtual memory, you will notice a significant performance drop. The key is to have enough RAM to handle everything you tend to work on simultaneously -- then, the only time you "feel" the slowness of virtual memory is is when there's a slight pause when you're changing tasks. When that's the case, virtual memory is perfect.

When it is not the case, the operating system has to constantly swap information back and forth between RAM and the hard disk. This is called thrashing, and it can make your computer feel incredibly slow.

The area of the hard disk that stores the RAM image is called a page file. It holds pages of RAM on the hard disk, and the operating system moves data back and forth between the page file and RAM. On a Windows machine, page files have a .SWP extension.

Next, we'll look at how to configure virtual memory on a computer.

Sunday, June 2, 2013

What is memory leak? How it affects performance of application?

A memory leak is a type of unintentional memory consumption by program where the program fails to release memory when no longer needed. This condition is normally the result of a bug in a program that prevents it from freeing up memory that it no longer needs. This term has the potential to be confusing, since memory is not physically lost from the computer. Rather, memory is allocated to a program, and that program subsequently loses the ability to access it due to logic flaws.

Now the most important question comes up, how do they affect Loadrunner functioning?

This is so obvious, memory leak, if left unattended and not corrected, could prove to be fatal. Memory leaks can be found out by running tests for long duration (say about an hour) and continuously checking memory usage.

Issues caused by memory leaks are essentially based on two variables for a standalone windows application

1) Frequency of usage
2) Size of memory leak.

If either one or both are very high, the computer might come to a point when no memory is available for other applications. This could lead to a computer crash. If it is a network based application then you will also have to consider network traffic. If each network transaction causes a memory leak, then a high volume of network transactions could also prove dangerous.

What is Virtual memory and how Virtual memory works?

Virtual memory is a technique that allows the execution of processes that may not be completely in memory. One major advantage of this scheme is that programs can be larger than physical memory.

Further, virtual memory abstracts main memory into an extremely large, uniform array of storage, separating logical memory as viewed by the user from physical memory. This technique frees programmers from the concerns of memory-storage limitations.

Virtual memory also allows processes to easily share files and address spaces, and it provides an efficient mechanism for process creation.

Virtual memory is not easy to implement, however, and may substantially decrease performance if it is used carelessly.

How Virtual Memory is useful?

The ability to execute a program that is only partially in memory would confer many benefits:

1. A program would no longer be constrained by the amount of physical memory that is available. Users would be able to write programs for an extremely large virtual-address space, simplifying the programming task.

2. Because each user program could take less physical memory, more programs could be run at the same time, with a corresponding increase in CPU utilization and throughput, but with no increase in response time or turnaround time.

3. Less I/O would be needed to load or swap each user program into memory, so each user program would run faster.

Thus, running a program that is not entirely in memory would benefit both the system and the user.

Thus we see that because of Virtual memory your computer feel like is has unlimited RAM space even though it only has 2 GB installed. Because hard disk space is so much cheaper than RAM chips, it also has a nice economic benefit. ­

Implementation of Virtual Memory

Virtual memory is commonly implemented by demand paging. In a demand paging system processes reside on secondary memory (which is usually a disk). When we want to execute a process, we swap it into memory. Rather than swapping the entire process into memory, however, we use a lazy swapper, which never swaps a page into memory unless that page will be needed.

Saturday, June 1, 2013

How to estimate memory requirements for Vusers in Loadrunner?

When we run load tests each virtual users uses some memory of host system for example web VUsers will need memory for cookies and viewstates, this is called memory footprint also  known as memory requirement for a Vuser. This mainly depends on Vuser type (Web, Web Services, CITRIX, SAP GUI), application and system where you run the test.


If we take an example of web application in which your Web HTTP/HTML Vuser takes 4MB when running as a process, 100 Vusers would take 400 MB. Along with this network connections, third party programs that are running in background, memory consumed by application; all added together will give the total memory required.