|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-ACB79CEF-CA4D-5C96-AFCD-6AD7C7C26C53" xml:lang="en"><title>Thrashing |
|
13 Guide</title><shortdesc>Describes thrashing in terms of demand paging and how to prevent |
|
14 it. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <section id="GUID-378E14C9-A83A-56BD-BE7D-7DF565E58A46"><title>Introduction</title> <p>Thrashing |
|
16 is an undesirable state where most of the processes in the system are in the |
|
17 process of paging-in memory and none of the threads are doing useful work. |
|
18 This results in unacceptable system performance. </p> </section> |
|
19 <section id="GUID-E39982CD-62E4-4EA0-92A6-4BE9E7F9B00E"><title>Background information</title><p>These topics are useful background |
|
20 information on thrashing:</p><ul> |
|
21 <li><p>Paging </p></li> |
|
22 <li><p>Virtual memory </p></li> |
|
23 </ul></section> |
|
24 <section id="GUID-A2C57999-E701-40FF-872D-396AFD6FA082"><title>Thrashing features</title><p>The signs of thrashing in demand |
|
25 paging are: </p><ul> |
|
26 <li><p>The system performance rapidly becomes unacceptable, since no threads |
|
27 are doing useful work. The device will become unresponsive or appear to 'hang'. </p></li> |
|
28 <li><p>When observing paging activity logs it's seen that the same set of |
|
29 pages are paged in and out many times over the course of a use case. </p></li> |
|
30 <li><p>When observing paging activity logs there are long periods where many |
|
31 threads are waiting for pages to be paged in. </p></li> |
|
32 <li><p>There are large periods of null thread activity. </p></li> |
|
33 </ul></section> |
|
34 <section id="GUID-D8D94E88-7B6C-4408-B78D-162201224DB6"><title>Thrashing prevention</title><p>The following is a means of |
|
35 preventing thrashing from occurring: </p><ul> |
|
36 <li><p>Increase the size of the paging cache. This reduces page faults and |
|
37 hence the need to page-in memory. </p></li> |
|
38 <li><p>Mark the code or data involved as unpaged, for example if a 20MB buffer |
|
39 is actively used through a use-case and discarded afterwards there is little |
|
40 use in making it paged as it will need to always be in the page cache. </p></li> |
|
41 <li><p>Reduce the working set size so that it fits into the paging cache, |
|
42 for example instead of having four activities running concurrently, serialize |
|
43 them. </p></li> |
|
44 </ul></section> |
|
45 </conbody><related-links> |
|
46 <link href="GUID-44540C74-CD73-5D8E-A9E0-F90F46B4E7B1.dita"><linktext>Preventing |
|
47 And Recovering From Thrashing Guide</linktext></link> |
|
48 </related-links></concept> |