<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LoadRunner TnT &#187; Memory</title>
	<atom:link href="http://www.loadrunnertnt.com/tag/memory/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.loadrunnertnt.com</link>
	<description>Performance Testing, LoadRunner Tips &#38; Tricks</description>
	<lastBuildDate>Mon, 08 Mar 2010 07:57:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Achieving High Performance Application in Java Coding! – Part 2</title>
		<link>http://www.loadrunnertnt.com/coding/achieving-high-performance-application-in-java-coding-%e2%80%93-part-2/</link>
		<comments>http://www.loadrunnertnt.com/coding/achieving-high-performance-application-in-java-coding-%e2%80%93-part-2/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 07:25:01 +0000</pubDate>
		<dc:creator>TnT Admin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[finalize]]></category>
		<category><![CDATA[garbage collection]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[optimizing]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[reflection]]></category>

		<guid isPermaLink="false">http://www.loadrunnertnt.com/?p=666</guid>
		<description><![CDATA[Following our high performance application in java coding:

Handle the appropriate exceptions (checked); do not leave it to the unchecked exceptions – When an exception is thrown, the runtime system will exhaustively search all the methods on the call stack for the appropriate exception handler.  This is expensive and thus we want to minimize the search [...]]]></description>
			<content:encoded><![CDATA[<p>Following our <a href="../coding/achieving-high-performance-application-in-java-coding/">high performance application in java coding</a>:<a href="http://www.loadrunnertnt.com/wp-content/uploads/2010/01/web_coding_collage-150x1502.jpg"><img class="alignright size-full wp-image-702" title="web_coding_collage-150x150" src="http://www.loadrunnertnt.com/wp-content/uploads/2010/01/web_coding_collage-150x1502.jpg" alt="" width="71" height="71" /></a><span id="more-666"></span></p>
<ul>
<li><strong>Handle the appropriate exceptions (checked); do not leave it to the unchecked exceptions</strong> – When an exception is thrown, the runtime system will exhaustively search all the methods on the call stack for the appropriate exception handler.  This is expensive and thus we want to minimize the search in the call stack in finding the appropriate exception handler to improve performance which can be achieved by throwing and catching the appropriate exceptions (checked exceptions).  Do not leave exception handling as an after-thought or code-as-you-go during development.</li>
<li><strong>Do not incorporate exception handling as control flow</strong> – As mentioned earlier, exceptions are expensive and should only be used for abnormality (planned and unplanned).  An if-then-else construct will perform better without the exception handling as there is no need to transfer control to locate the appropriate exception handling.   As such, review the codes and remove any throw statements from the coding that are used in an if-then-else construct.</li>
<li><strong>Avoid and remove the use of Reflection API in the codes</strong> – Reflection involves types that are dynamically resolved, which restricts optimization in certain JVMs.  Consequently, reflective operations have slower performance than non-reflective counterparts.  Therefore, unless there is a dire need for reflection to be used in the java program, it is best to leave it out if you need a high performance program.</li>
<li><strong>Let the system decide the garbage collection</strong> – If possible, remove any attempt to call system.gc(). system.gc() triggers a full collection , which includes tracing all live objects in the heap and sweeping and compacting the old generation. This can be a lot of work. In general, it is better to let the system decide when it needs to collect the heap, and whether or not to do a full collection.  Note: system.gc() merely signals (marks) the java program to do garbage collection, but it will not be an immediate garbage collection taking place.</li>
<li><strong>Reduce memory by avoiding the use of finalizers </strong>– An object is in the <em>finalized</em> state if it is still unreachable after running the finalize method, if any, has been run.  The finalized object is then awaiting deallocation and deallocation will not take place until the finalizer is run which is dependent on the VM.  The use of finalizer will extend the lifetime of the <em>finalized</em> object and it can be counter-intuitive when no deallocation takes place and when you intended to have the object being short-lived.   In order to avoid these short-lived objects being extended during the lifetime of the heap memory, it is best to consider the use of finalizers or free the resources explicitly.   (Source: <a href="http://java.sun.com/docs/books/performance/1st_edition/html/JPAppGC.fm.html">Appendix A, The Truth About Garbage Collection</a> and <a href="http://www.ibm.com/developerworks/library/j-jtp01274.html">Java theory and practice: Garbage Collection and Performance</a>)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.loadrunnertnt.com/coding/achieving-high-performance-application-in-java-coding-%e2%80%93-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding Memory: System Working Set</title>
		<link>http://www.loadrunnertnt.com/concepts/understanding-memory-system-working-set/</link>
		<comments>http://www.loadrunnertnt.com/concepts/understanding-memory-system-working-set/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 16:09:57 +0000</pubDate>
		<dc:creator>TnT Admin</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.loadrunnertnt.com/?p=197</guid>
		<description><![CDATA[Windows OS functions also consumes RAM, so the system has a working set that needs to be controlled and managed like any other process. In this section we discuss the components of the system working set and look at how it is managed.
Both system code and device driver code occupies memory. In addition, the OS [...]]]></description>
			<content:encoded><![CDATA[<p>Windows OS functions also consumes <strong>RAM</strong>, so the system has a working set that needs to be controlled and managed like any other process. In this section we discuss the components of the system working set and look at how it is managed.<span id="more-197"></span></p>
<p>Both <strong>system code</strong> and <strong>device driver code</strong> occupies <strong>memory</strong>. In addition, the OS allocates data structures in two areas of memory: a pool for non-pageable storage and a pool for pageable storage. Data structures accessed by OS and driver functions when interrupts are disabled must be resident in RAM at the time they are referenced. These data structure are usually allocated from the <strong>non-pageable pool</strong> so that they reside permanently in RAM. The Pool Nonpages Bytes counter in the Memory object shows the amount of RAM currently allocated that is permanently resident in RAM.</p>
<p>Mainly, though, most system data structure are pageable: they are created in a pageable pool of storage and subject to page replacement like the virtual memory pages of any other process. The Windows OS maintains a working set of active pages in RAM that are subject to the same page replacement policy as ordinary process address spaces. The Cache Bytes counter provides the total number of resident pages in the current system working set. <strong>Cache Bytes</strong> is the sum of the <strong>System Cache Resident Bytes</strong>, <strong>System Driver Resident Bytes</strong>, <strong>System Code Resident Bytes</strong>, and <strong>Pool Paged Resident Bytes</strong> counters. The OS’s working set is known as the cache because it also includes resident pages of the Windows file cache, the OS function that typically consumes more RAM than any other.</p>
<p>The system working set is subject to the same local page replacement policy as ordinary process working sets. By default, the system cache has a minimum working set of about 4.8MB and a maximum working set of a little more than 2000 pages, or about 8MB. Just like ordinary processes, when the OS is running at its maximum working set value and it references a page that is not currently resident (causing a page fault), the new page displaces an older page from the system cache and the older page is moved to the Standby List. Just like ordinary processes, when the Balance Set manager thread responsible for page trimming detects that the OS is running at its current working set maximum and at least 4MB of RAM available, it adjusts the system working set upwards 20 pages at a time.</p>
<p>A registry parameter called <strong>LargeSystemCache</strong> can be set to change the system working set maximum value. When the LargeSystemCache is turned on, the system working set maximum is set to approximately 80% of the total amount of RAM installed.</p>
<p>Turning on the LargeSystemCache setting, which boosts the value of the system’s maximum working set size, favors the system working set over the working sets of other processes. It allows the working set of the system, which includes the Windows file cache, to grow relatively unconstrained in relation to other process working sets and to absorb the bulk of the system’s uninstalled RAM.</p>
<p><a title="Windows 2000 Performance Guide" href="resources/66-books" target="_blank">(Source: Windows 2000 Performance Guide by Mark Friedman &amp; Odysseas Pentakalos)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.loadrunnertnt.com/concepts/understanding-memory-system-working-set/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Understanding Memory: LRU</title>
		<link>http://www.loadrunnertnt.com/concepts/understanding-memory-lru/</link>
		<comments>http://www.loadrunnertnt.com/concepts/understanding-memory-lru/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 15:58:45 +0000</pubDate>
		<dc:creator>TnT Admin</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.loadrunnertnt.com/?p=200</guid>
		<description><![CDATA[LRU maintains an ordering of resident virtual memory pages from Most Recently Referenced to Least Recently Used. When real memory is full and an executing program references a pages that is not currently resident in memory (i.e. a page fault occurs), the Least Recently Used page in real memory is replaced with the current Most [...]]]></description>
			<content:encoded><![CDATA[<p><strong>LRU</strong> maintains an ordering of resident virtual memory pages from <strong>Most Recently Referenced</strong> to <strong>Least Recently Used</strong>. When real memory is full and an executing program references a pages that is not currently resident in memory (i.e. a page fault occurs), the Least Recently Used page in real memory is replaced with the current Most Recently Referenced page. Older pages, by inference, are less likely to by referenced again soon by executing programs, so they are the best candidates for page replacement. Older pages selected for replacements are effectively removed from memory – the next time they are referenced they must be retrieved from a paging file. If the page in memory was modified, the OS must first update the copy on the paging file before it is definitely removed.<span id="more-200"></span></p>
<p>In practice, many <strong>LRU</strong> virtual memory implementations, including the one found in Windows, attempt to maintain some pool of free pages in RAM. This pool of <strong>Available Bytes</strong> allows the OS to schedule an I/O to the paging file to resolve the page fault immediately. Then, when this pool becomes depleted, a round of page stealing is triggered, which replenishes the pool of free pages before it is completely exhausted. (Windows refer it as page trimming). Windows uses <strong>page trimming</strong> on a regular basis to maintain its pool of free pages (reported as Available Bytes).</p>
<p>The challenge in Windows is to identify older pages without relying on specific processor hardware support. This is accomplished by trimming pages from process working sets provisionally. After trimming pages aggressively from active processes, Windows adds them to the pool of Available Bytes, but tags them initially as being in a provisional state. They are not immediately removed from RAM. The next time threads from active processes are scheduled to run, they reference the pages are active and these stolen pages are allowed to transition back into the process working set. So-called transition faults or soft page faults are handled quickly, with a minimum overhead. Eventually, what are left behind in the pool of Available Pages are older, unused pages that are good candidates to be replaced.</p>
<p>Trimmed process working set pages are placed initially in the <strong>Standby List</strong>, where they are allowed to transition fault back into their process working set the next time they are referenced. Transition faults are distinguished from hard page faults, which must be satisfied by reading the paging file disk. Pages in the Standby List that are un-referenced long enough are eventually moved to the Free List. When the <strong>System Zero Thread</strong> executes, it zeros out the contents of pages on the Free List, which allows them to move to the Zero List. Pages from the Zero List are allocated whenever either a hard page fault occurs or a process references a brand new page (also known as <strong>Demand Zero</strong> page faults). Together, the size of the Standby List, the Free List, and the Zero List are added together and reported as Available Bytes.</p>
<p>The <strong>page trimming</strong> procedure is threshold-driven. Page trimming is invoked when one or more of the List structures that make up the pool of Available Bytes is depleted. In addition, Windows schedules writes to the paging file when the number of changed pages exceeds a threshold value. Modified pages are written in bulk to disk by Modified Page Writer threads, again based on the threshold values being exceeded.</p>
<p><span style="text-decoration: underline;"><strong>Measurement Support</strong></span></p>
<p>The <strong>Transition Faults/sec</strong> counter in the Memory object reports the rate at which soft page faults occur. Similarly, <strong>Demand Zero Faults/sec</strong> reports the rate at which new pages are being created. <strong>Pages Output/sec</strong> shows the rate at which changed pages had been copied to disk. By implication, since real memory is a closed system:</p>
<p><em>Pages trimmed/sec = Transition Faults + Demand Zero Faults + Hard page faults</em></p>
<p>Plus any change in the size of the Available Bytes buffer from one interval to the next. The individual sizes of the Standby, Free, and Zero lists are not reported. Nor does Windows report the rate at which the Balance Set Manager’s page trimming routine runs, nominally at least once per second.</p>
<p>The Pages Read/sec counter corresponds to the rate of hard page faults requiring the OS to retrieve a page from disk. The fact that Pages Input/sec is usually larger than Pages Read/sec reflects the use of anticipatory paging. <strong>Pages Input/sec</strong> is the actual number of pages retrieved from disk. Calculating:</p>
<p><em>Pages per page fault = Pages Input/sec / Pages Read/sec</em></p>
<p>Reports the average number of pages retrieved per page fault. Similarly, the <strong>Pages written/sec</strong> counter shows the number of page write operations that were initiated, and Pages output/sec counts the number of physical 4K pages actually written.</p>
<p>When the average number of pages read or written to disk is consistently above two pages per page fault or page write operation, and more than 10 – 20% of all I/Os to the disk are the result of paging operations, it is probably time to add another paging file , if possible. Adding a second paging file spreads the paging I/O load across another physical disk and usually improves page fault resolution time substantially.</p>
<p>Windows supplies one other important measurement of overall paging activity, namely Page Faults/sec. Unfortunately, interpreting how the Page Faults/sec counter relates to the other paging activity counters is problematic.<strong> Page Faults/sec</strong> includes both <strong>Transition (soft) Faults/sec</strong> and <strong>hard page faults (Pages Read/sec)</strong>. It evidently also includes the number of <strong>Cache Faults/sec</strong> due to the normal diversion of application I/O to the paging subsystem. There is strong evidence that it also includes the number of Demand Zero Faults/sec.</p>
<p>Page Faults/sec = Cache Faults/sec + Demand Zero Faults/sec + Pages Read/sec + Transition Faults/sec</p>
<p><a title="Windows 2000 Performance Guide" href="resources/66-books" target="_blank">(Source: Windows 2000 Performance Guide by Mark Friedman &amp; Odysseas Pentakalos)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.loadrunnertnt.com/concepts/understanding-memory-lru/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding Memory: Available Bytes</title>
		<link>http://www.loadrunnertnt.com/concepts/understanding-memory-available-bytes/</link>
		<comments>http://www.loadrunnertnt.com/concepts/understanding-memory-available-bytes/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 15:41:20 +0000</pubDate>
		<dc:creator>TnT Admin</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.loadrunnertnt.com/?p=203</guid>
		<description><![CDATA[You can watch real memory filling up by monitoring Available Bytes, which represents free, unallocated RAM. Available Bytes counts the number of free pages in RAM at any particular time; it is the all-important buffer of free pages the OS maintains in order to resolve page faults quickly. The Available Bytes counter, like all the [...]]]></description>
			<content:encoded><![CDATA[<p>You can watch real memory filling up by monitoring <strong>Available Bytes</strong>, which represents free, unallocated <strong>RAM</strong>. Available Bytes counts the number of free pages in RAM at any particular time; it is the all-important buffer of free pages the OS maintains in order to resolve page faults quickly. The Available Bytes counter, like all the real memory allocation counters, report the amount of RAM currently not allocated to any process in bytes.</p>
<p><span id="more-203"></span>When you launch Task Manager, on the Performance Tab, the <strong>MEM Usage</strong> and Memory Usage History Graphs refer to virtual memory Committed Bytes. The value corresponds to the Commit Charge (K) Total field in the lower-left quadrant. The Task Manager <strong>Commit Charge</strong> field reports on virtual memory allocations in 1024 kilobytes (KB) segments; the corresponding Committed Bytes Limit is also shown. The Memory Usage History graph charts Committed Bytes against the Commit Limit, which servers as the maximum value for the Y-axis.<br />
In the upper-right text quadrant (immediately below the Memory Usage History timeline), the Task Manager shows Total system memory (the amount of installed RAM), Available, and System Cache, all denominated in 1000 bytes. The Task Manager Available field corresponds exactly to the System Monitor <strong>Available Kbytes</strong> counter, by the way.</p>
<p>As you open new applications on your desktop, watch as virtual memory <strong>Committed Bytes</strong> increases while Available Bytes decreases in tandem. As a general rule of thumb, a 5 – 10% cushion of Available Bytes is normally ample.</p>
<p>If you are able to start enough application programs, you will eventually observe that the number of Committed Bytes begins to exceed the amount of physical RAM installed. This is the first indication that real memory might be filling up. As long as Committed Bytes is less than the amount of RAM installed, every virtual memory page requested by application process can fit in RAM. That means the amount of RAM installed is sufficient for this workload. However, just because Committed Bytes is greater than the amount of RAM installed dos not mean RAM is completely allocated. Some applications committed pages that have not been referenced in a long time may not be currently resident in real memory. Idle pages are subject to being paged out of the system, so RAM may still not be completely allocated.</p>
<p>Windows continues to permit applications to allocate more virtual memory up to the <strong>Committed Bytes</strong> Limit. If your applications continue to add more Committed Bytes to the system, at some point all those active virtual memory pages will not fit easily into physical RAM and you will start to notice an impact on system performance. At this point of time, when you click on an application that you have not accessed in a while, you are likely to hear the hard disk grinding away. Windows is performing paging I/O to the disk, taking older pages in memory and writing them to the paging file to make room for current pages that t must read back into memory from the paging file disk. As you continue to open new applications and drive Committed Bytes higher, the slowdown in system performance will eventually become acute, which eventually might leads to trashing.</p>
<p>When the number of virtual memory Committed Bytes starts to exceed the amount of physical RAM installed, you can probably also observe that the number of Available Bytes begins to stabilize at approximately 4MB. Windows attempts to maintain a 4MB cushion of Available Bytes in order to service application requests for a new page quickly. If the working sets of active processes exceed the size of physical memory, there is contention for real memory. In Windows, you can often observe signs of this contention when the system’s pool of Available Bytes reaches about 4MB. At approximately 4MB of available RAM, Windows crosses a threshold where behavior of its virtual memory management policy changes. If Windows has difficulty maintaining a 4MB pool of available RAM and the demand for virtual memory continues to increase, you will likely observe telltale signs of trashing.</p>
<p><a title="Windows 2000 Performance Guide" href="resources/66-books" target="_blank">(Source: Windows 2000 Performance Guide by Mark Friedman &amp; Odysseas Pentakalos)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.loadrunnertnt.com/concepts/understanding-memory-available-bytes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding Memory: Virtual Memory shortage alerts</title>
		<link>http://www.loadrunnertnt.com/concepts/understanding-memory-virtual-memory-shortage-alerts/</link>
		<comments>http://www.loadrunnertnt.com/concepts/understanding-memory-virtual-memory-shortage-alerts/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 15:33:36 +0000</pubDate>
		<dc:creator>TnT Admin</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.loadrunnertnt.com/?p=205</guid>
		<description><![CDATA[Waiting for the paging file to reach 90% threshold maybe too late, especially on any system configuration with a single paging file. Therefore, the recommendation is to take remedial action long before 90% threshold is reached.
When the systems reaches the 90% threshold, not only are there few available virtual memory slots, what slots are available [...]]]></description>
			<content:encoded><![CDATA[<p>Waiting for the paging file to reach 90% threshold maybe too late, especially on any system configuration with a single paging file. Therefore, the recommendation is to take remedial action long before 90% threshold is reached.</p>
<p>When the systems reaches the 90% threshold, not only are there few available virtual memory slots, what slots are available maybe very scattered, preventing applications from allocating large blocks of virtual storage. When the system is approaching the Commit Limit, applications may begin to fail because they cannot allocate virtual memory. For instance, the system application responsible for sending the warning message to the console and to the event log that the paging file is 90% full sometimes fails because it cannot allocate virtual memory, so you might not even receive notification that the event has occurred. In short, by the time the 90% paging file allocation threshold is reached, it may already be too late to take corrective action.<span id="more-205"></span></p>
<p>A more proactive approach uses continuous performance monitoring to generate an alert when % Committed Bytes exceeds, say, a 70% threshold value. If you are operating a system above this level of virtual memory utilization consistently, it is time to explore longer-term remedial measure that might involve adding more physical memory, defining additional paging file space, or both. Computers systematically exceeding 70% &#8211; 80% Committed Bytes may suffer from serious performance degradation due to excessive demand paging activity anyway.</p>
<p><a title="Windows 2000 Performance Guide" href="resources/66-books" target="_blank">(Source: Windows 2000 Performance Guide by Mark Friedman &amp; Odysseas Pentakalos)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.loadrunnertnt.com/concepts/understanding-memory-virtual-memory-shortage-alerts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding Memory: Performance Concerns</title>
		<link>http://www.loadrunnertnt.com/concepts/understanding-memory-performance-concerns/</link>
		<comments>http://www.loadrunnertnt.com/concepts/understanding-memory-performance-concerns/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 16:03:37 +0000</pubDate>
		<dc:creator>TnT Admin</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.loadrunnertnt.com/?p=207</guid>
		<description><![CDATA[A pervasive concern of virtual memory schemes is that the performance of application programs may suffer when there is a shortage of real memory and too many page faults occur. Windows maintain a pool of available (free) real memory pages to resolve page faults quickly. Whenever the pool is depleted, Windows replenishes its buffer of [...]]]></description>
			<content:encoded><![CDATA[<p>A pervasive concern of virtual memory schemes is that the performance of application programs may suffer when there is a shortage of real memory and too many page faults occur. Windows maintain a pool of available (free) real memory pages to resolve page faults quickly. Whenever the pool is depleted, Windows replenishes its buffer of available RAM by trimming older (less frequently referenced) pages of active processes and by swapping the pages of idle foreground applications to disk.<span id="more-207"></span></p>
<p>If the supply of real memory is ample, executing programs seldom encounter page faults that delay their execution, and the OS has no difficulty maintaining a healthy supply of free pages.If the system is short on real memory (relative to the memory required to back concurrently referenced pages with actual physical memory pages), a high rate of page fault may occur, slowing the performance of executing programs considerably. Obviously, the OS may not be able to maintain an adequate pool of available real memory when there is not enough real memory to go around.</p>
<p>You want to avoid three types of performance problems that can occur when there is too little real memory:<br />
<strong>Too many page faults:</strong> Having too many page faults leads to excessive program execution delays during page fault resolution. This is the most straightforward performance problem associated with virtual memory addressing.</p>
<p><strong>Disk contention:</strong> Virtual memory systems that are subject to a high page fault rate may also encounter disk performance problems because of the extra disk I/O workload generated to resole page faults. In systems where the paging file (or files) is located on the same disk (or disks) as application data files, I/O to the paging file can limit the ability of applications to access their own data files. A possible secondary effect of disk contention is elongation of page fault resolution time, further delaying the programs affected when page faults do occur.</p>
<p><strong>Competition for memory:</strong> Because real memory is allocated to executing programs on demand, there is another potential pitfall. In virtual memory systems, programs resident in memory compete for access to available physical memory. The inevitable result of competition when memory is scarce is that the memory access pattern of one program can unduly influence other running programs.</p>
<p>A severe shortage of real memory can seriously impact performance. Moving pages back and forth between disk and memory consumes both processing and disk capacity. A system forced to use too many CPU and disk resources on virtual memory management tasks and too few on the application workload is said to be thrashing.</p>
<p>Inevitably, the solution to a paging problem is to install more real memory capacity. Alternatively (and less definitely), it may help to improve page fault resolution time by focusing on disk I/O performance. This typically involves some combination of the following.</p>
<ul>
<li>Defining additional paging files across multiple (physical) disks,</li>
<li>Reducing disk contention by removing other heavily accessed files from the paging file physical disks, or</li>
<li>Upgrading to faster disks.</li>
</ul>
<p><a title="Windows 2000 Performance Guide" href="resources/66-books" target="_blank">(Source: Windows 2000 Performance Guide by Mark Friedman &amp; Odysseas Pentakalos)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.loadrunnertnt.com/concepts/understanding-memory-performance-concerns/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Understanding Memory: Page Fault Resolution</title>
		<link>http://www.loadrunnertnt.com/concepts/understanding-memory-page-fault-resolution/</link>
		<comments>http://www.loadrunnertnt.com/concepts/understanding-memory-page-fault-resolution/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 15:55:08 +0000</pubDate>
		<dc:creator>TnT Admin</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.loadrunnertnt.com/?p=209</guid>
		<description><![CDATA[For all its virtues, virtual memory can raise some serious performance issues. Among them is execution delays encountered by programs whenever they reference virtual memory locations not in the current set of memory-resident pages. This is known as page fault. A program thread that incurs a page fault is halted during page fault resolution, the [...]]]></description>
			<content:encoded><![CDATA[<p>For all its virtues, virtual memory can raise some serious performance issues. Among them is execution delays encountered by programs whenever they reference virtual memory locations not in the current set of memory-resident pages. This is known as page fault. A program thread that incurs a page fault is halted during page fault resolution, the time it takes the OS to find the specific page on disk and restore it to real memory.<br />
<span id="more-209"></span>When a program execution thread attempts to reference an address on a page that is not currently resident in real memory, a hardware interrupt occurs that halts the executing program. An OS interrupt service routine (ISR) gains control following the interrupt and determines that the address referenced is valid, but is not currently resident. (If a program accesses an invalid memory location due to a logic error, e.g. referencing an un-initialized pointer, a similar hardware error occurs. It is up to the ISR to distinguish between the two conditions.) The OS then must remedy the situation by locating a copy of the desired page on a secondary storage, using an I/O operation to the paging file, and copying the designated page from disk into a free page in RAM. Once the page has been copied successfully, the OS re-dispatches the temporarily halted program, allowing the program thread to continue its normal execution cycle.</p>
<p><a title="Windows 2000 Performance Guide" href="resources/66-books" target="_blank">(Source:Windows 2000 Performance Guide by Mark Friedman &amp; Odysseas Pentakalos)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.loadrunnertnt.com/concepts/understanding-memory-page-fault-resolution/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Understanding Memory: Virtual Addressing</title>
		<link>http://www.loadrunnertnt.com/concepts/understanding-memory-virtual-addressing/</link>
		<comments>http://www.loadrunnertnt.com/concepts/understanding-memory-virtual-addressing/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 15:50:10 +0000</pubDate>
		<dc:creator>TnT Admin</dc:creator>
				<category><![CDATA[Concepts]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.loadrunnertnt.com/?p=211</guid>
		<description><![CDATA[Virtual memory is a feature supported by most advanced processors. Hardware support for virtual memory includes hardware mechanism to map from logical (virtual) memory address that application programs reference to physical (real) memory hardware addresses.
When an executable program’s image file is first loaded into memory, the logical memory address range of the application is divided [...]]]></description>
			<content:encoded><![CDATA[<p>Virtual memory is a feature supported by most advanced processors. Hardware support for virtual memory includes hardware mechanism to map from logical (virtual) memory address that application programs reference to physical (real) memory hardware addresses.</p>
<p>When an executable program’s image file is first loaded into memory, the logical memory address range of the application is divided into fixed-size chunks called pages. These logical pages are them mapped to similar-sized physical pages that are resident in real memory.<span id="more-211"></span></p>
<p>This mapping is dynamic in that frequently referenced logical addresses tend to reside in physical memory (also know s RAM, real memory, or main memory), while infrequently referenced pages are relegated to paging files on secondary disk storage. The active subset of virtual memory pages associated with a single process’s address space currently resident in RAM is known as the process’s working set, because they are the active pages referenced by the programs as it executes.</p>
<p>Virtual addressing is designed to be transparent to application programs, allowing them to be written without regard to specific real memory limitations of this or that computer. Virtual addressing even makes it possible for an executing program to reference an address space that is larger than the amount of physical memory installed on a particular computer. Virtual addressing allows a programmer to exploit what looks like a virtually infinite-sized computer memory where each individual process can address up to 4 GB of virtual addresses. As of the above, performance issues still exists when the OS attempts to reference more memory locations than can actually fit inside real memory.</p>
<p>Virtual memory system works well because executing programs seldom require all the associated code and data areas they allocate to be resident in physical memory concurrently in order to run. With virtual memory, only the active pages associated with a program’s current working set remain resident in real memory. On the other hand, virtual memory systems can run very poorly when the working sets of active processes greatly exceed the amount of physical RAM that the computer contains. It is important to understand the logical and physical memory usage to diagnose performance problems arising from real memory being over-committed.</p>
<p><a title="Windows 2000 Performance Guide" href="resources/66-books" target="_blank">(Source: Windows 2000 Performance Guide by Mark Friedman &amp; Odysseas Pentakalos)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.loadrunnertnt.com/concepts/understanding-memory-virtual-addressing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting memory bottlenecks</title>
		<link>http://www.loadrunnertnt.com/analyze/detecting-memory-bottlenecks/</link>
		<comments>http://www.loadrunnertnt.com/analyze/detecting-memory-bottlenecks/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 06:46:26 +0000</pubDate>
		<dc:creator>TnT Admin</dc:creator>
				<category><![CDATA[Analyze]]></category>
		<category><![CDATA[Bottleneck]]></category>
		<category><![CDATA[Memory]]></category>

		<guid isPermaLink="false">http://www.loadrunnertnt.com/?p=327</guid>
		<description><![CDATA[Monitoring the system memory (RAM) is not usually helpful in identifying memory performance problems. A better indicator will be monitoring paging activities to the page/swap file.  Memory paging activities will be covered in another article.  Most current OS have virtual memory comprising of the actual (real) system memory using physical RAM chips, and [...]]]></description>
			<content:encoded><![CDATA[<p>Monitoring the system memory (RAM) is not usually helpful in identifying <strong>memory</strong> performance problems. A better indicator will be monitoring <strong>paging activities</strong> to the page/swap file.  Memory paging activities will be covered in another article.  Most current OS have <strong>virtual memory</strong> comprising of the actual (real) system memory using physical RAM chips, and one or more page/swap files on the system disks. Processes that are currently running are operating in real memory. The OS can take pages from any of the processes currently in real memory and swap them out to disk. This is known as paging. Paging leaves free space in real memory to allocate to other processes that need to bring in a page from disk. Obviously, if all the processes currently running can fit into real memory, there is no need for the system to swap out any pages. However, if there are too many processes to fit into real memory, <strong>paging</strong> allows the system to free up system memory to run more processes.<span id="more-327"></span></p>
<p><strong>Paging</strong> affects system performance in many ways. One, is that if a process moved some some pages to disk and the process becomes runnable, the OS has to retrieve the pages from the disk before that process can be run which results to delays in performance. In addition, both CPU and the disk I/O spend time doing the paging, reducing available processing power and increasing the load on the disks. This cascading effect involving both the CPU and I/O can degrade the performance of the whole system in such a way that it maybe difficult to even recognize that paging is the problem. The extreme version of too much paging is <strong>thrashing</strong>, in which the system is spending too much time moving pages around that it fails to perform any other significant work. (The next step is likely to be a system crash).</p>
<p>A little paging of the system does not affect the performance enough to cause concern. In fact, some paging can be considered good which indicates that the system’s memory resources are fully utilized. But at the point where paging becomes a significant overhead, the system is overloaded. To monitor paging activities is easy. On UNIX, the utilities <em>vmstat</em> and <em>iostat</em> provide details as to the level of paging, disk activity and memory levels. On Windows, the performance monitor has categories to show these details, such as <em>Pages/sec</em>, <em>Page faults/sec</em> and <em>% Page files usage</em>.</p>
<p>If there is more paging than optimal, the system’s RAM is insufficient or processes are too big. To improve this situation, you need to reduce the memory being used by (a) reducing the number of processes or (b) the memory utilization of some processes. Alternatively, you (c) can add RAM.  If the problem is caused by a combination of your application and others, you can partially address the situation by using <strong>process priorities</strong>. By issuing priorities to the processes, you need to be aware that using this option reduces the amount of RAM available to all other processes, which can make overall system performance worse. Therefore measure the trade-offs before deciding the resolution.</p>
<p><a title="Java Performance Tuning" href="index.php?view=article&amp;catid=38%3Arecommended-resources&amp;id=66%3Abooks&amp;option=com_content&amp;Itemid=41" target="_blank">(Source: &#8220;Java Performance Tuning&#8221;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.loadrunnertnt.com/analyze/detecting-memory-bottlenecks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Detecting memory leaks</title>
		<link>http://www.loadrunnertnt.com/analyze/detecting-memory-leaks/</link>
		<comments>http://www.loadrunnertnt.com/analyze/detecting-memory-leaks/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 07:26:54 +0000</pubDate>
		<dc:creator>TnT Admin</dc:creator>
				<category><![CDATA[Analyze]]></category>
		<category><![CDATA[Memory]]></category>

		<guid isPermaLink="false">http://www.loadrunnertnt.com/?p=334</guid>
		<description><![CDATA[Memory leaks are caused by programs that allocate virtual memory and fail to free after they are finished with it. Memory leaks are nasty program bugs that are sometimes difficult to find. A program containing memory leak bug often executes to completion and produces the correct results, so the presence of the bug is not [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Memory leaks</strong> are caused by programs that allocate virtual memory and fail to free after they are finished with it. Memory leaks are nasty program bugs that are sometimes difficult to find. A program containing memory leak bug often executes to completion and produces the correct results, so the presence of the bug is not always detected. In fact, as long as the program containing the memory leak does not impact other executing processes, the bug can go undetected for a long time.<span id="more-334"></span></p>
<p>The telltale sign of a memory leak is that <strong>Committed Bytes </strong>at the system level and/or <strong>Virtual Bytes</strong> at the process level are continuously increasing. Eventually, a program with a memory leak exhausts the system’s supply of virtual memory, which can cause other running programs and even system code to fail as the system runs up against the virtual memory Committed Bytes limit. Depending on the rate at which the defective program leaks memory and the amount of excess virtual memory available, it can be a long time before any dire effects are evident.</p>
<p>A program that is leaking memory by allocating and then failing to free some private virtual memory areas is relatively easy spot because the process Virtual Bytes counter is continuously increasing. It is often harder to detect programs that allocate shared memory from the system’s <strong>Pageable Pool</strong> and fail to release that. Because virtual memory allocated in the shared memory region of the Pageable Pool is not associated with any specific process, finding the offending program can be difficult. Often, it is necessary to use the process elimination to find the offender.</p>
<p>(Source: <a title="Windows 2000 Performance Guide, Mark Friedman &amp; Odysseas Pentakalos" href="index.php?view=article&amp;catid=38%3Arecommended-resources&amp;id=66%3Abooks&amp;option=com_content&amp;Itemid=41" target="_blank">Windows 2000 Performance Guide, Mark Friedman &amp; Odysseas Pentakalos</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.loadrunnertnt.com/analyze/detecting-memory-leaks/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
