diff -r 578be2adaf3e -r 307f4279f433 Adaptation/GUID-44540C74-CD73-5D8E-A9E0-F90F46B4E7B1.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adaptation/GUID-44540C74-CD73-5D8E-A9E0-F90F46B4E7B1.dita Fri Oct 15 14:32:18 2010 +0100 @@ -0,0 +1,54 @@ + + + + + +Preventing +And Recovering From Thrashing TutorialDescribes how to reduce the chance of thrashing occurring in demand +memory and how to recover from thrashing. +
Introduction

Thrashing +is a state where the vast majority of the processing time is spent paging +memory in and out of the system and very little is spent useful work. If this +situation persists, then the system performance rapidly becomes unacceptable +and will appear to the user to have hung.

+
Background information

The following is useful background +reading:

    +
  • Thrashing

  • +
+
Thrashing features

When thrashing occurs the device +will appear to do nothing or 'hang' for period. Unlike a deadlock however, +the device can recover from thrashing.

+
Prevention of thrashing

The following can be used +reduce the chance of thrashing:

    +
  • Compress pages in memory to decrease the amount of memory that has +to be paged in and out

  • +
  • Limit the maximum size of each process's paged memory to the minimum +size of the paging cache

  • +
  • Partition the page cache per-process and allocate pages to processes + based on the Working Set Size (WSS) of threads in that process

  • +
  • Swap out the oldest pages in advance to free up memory to cope with +spikes in paging demand

  • +
  • Don't let threads steal pages from other threads

  • +
+
Recovery from thrashing

The possible courses of +action to undertake, should thrashing occur, are :

    +
  • Reboot the device

  • +
  • Kill a thread

  • +
  • Decrease the number +of paged threads running concurrently

  • +
  • Pick one thread with +a high page fault rate and stop other threads stealing pages from the thread's +associated process

  • +
  • Prompt the user-side +memory manager to close down applications.

  • +
+
+Thrashing +guide +
\ No newline at end of file