0

Hi All I have read these threshold parameters (Lotsfree, Desfree, Minfree) used in Solaris in memory management. Lotsfree=amount of free memory to begin paging. Desfree=amount of free memory to increase paging. Minfree=amount of free memory to begin swapping. In my understanding the last should be greater than all, but in reality it is completely different. How? Please explain.

jlliagre
  • 29,783
  • 6
  • 61
  • 72

2 Answers2

2

Read this:

Paging-Related Parameters

The Solaris OS uses a demand paged virtual memory system. As the system runs, pages are brought into memory as needed. When memory becomes occupied above a certain threshold and demand for memory continues, paging begins. Paging goes through several levels that are controlled by certain parameters.

The general paging algorithm is as follows:

A memory deficit is noticed. The page scanner thread runs and begins to walk through memory. A two-step algorithm is employed:

    A page is marked as unused.

    If still unused after a time interval, the page is viewed as a subject for reclaim.

If the page has been modified, a request is made to the pageout thread to schedule the page for I/O. Also, the page scanner continues looking at memory. Pageout causes the page to be written to the page's backing store and placed on the free list. When the page scanner scans memory, no distinction is made as to the origin of the page. The page might have come from a data file, or it might represent a page from an executable's text, data, or stack.

As memory pressure on the system increases, the algorithm becomes more aggressive in the pages it will consider as candidates for reclamation and in how frequently the paging algorithm runs. (For more information, see fastscan and slowscan.) As available memory falls between the range lotsfree and minfree, the system linearly increases the amount of memory scanned in each invocation of the pageout thread from the value specified by slowscan to the value specified by fastscan. The system uses the desfree parameter to control a number of decisions about resource usage and behavior.

The system initially constrains itself to use no more than 4 percent of one CPU for pageout operations. As memory pressure increases, the amount of CPU time consumed in support of pageout operations linearly increases until a maximum of 80 percent of one CPU is consumed. The algorithm looks through some amount of memory between slowscan and fastscan, then stops when one of the following occurs:

Enough pages have been found to satisfy the memory shortfall.

The planned number of pages have been looked at.

Too much time has elapsed.

If a memory shortfall is still present when pageout finishes its scan, another scan is scheduled for 1/4 second in the future.

The configuration mechanism of the paging subsystem was changed. Instead of depending on a set of predefined values for fastscan, slowscan, and handspreadpages, the system determines the appropriate settings for these parameters at boot time. Setting any of these parameters in the /etc/system file can cause the system to use less than optimal values.

...

Andrew Henle
  • 32,625
  • 3
  • 24
  • 56
0

I believe you are confusing paging (storing pages of memory back and forth between RAM and disk) and swapping (storing entire process memory back and forth between RAM and disk.)

  • The minfree value represent the value under which the OS starts swapping out complete processes memory to the disk. This used to be the unique way to handle low memory situation in ancient Unix implementations.

  • When there is more free memory than minfree but less than lotsfree, the system pages out memory to free space, not whole processes. This is much less aggressive and allows to some extents applications to keep running unaffected while having part of their memory not on RAM.

See also Difference Swapping and Paging

Community
  • 1
  • 1
jlliagre
  • 29,783
  • 6
  • 61
  • 72