Why my large memory accessing program is not using Swap space ?

Solution Verified - Updated -

Issue

  • On a 23.5 GB Memory system with 72 GB swap space the system does not make use of the swap space as it runs out of space. instead, the "offending" program requesting too much memory is killed.
  • It turns out that when actually the available Memory value is exceeded swapping does not come into effect and instead the program trying to access swap space is killed.
  • VM_overcommit parameters are also not working as per the kernel documentation.
  • Provided memory hogger program is not able to acess the full swap space:

#OUTPUT OF MEMORY HOGGER PROGRAM#
10:09:47 got 22918 MiB
10:09:47 got 22919 MiB
10:09:47 got 22920 MiB
10:09:48 got 22921 MiB
10:09:48 got 22922   <-- Reached upto 23 GB around.
killed

#OUTPUT OF SADC-COLLECTION SCRIPT#
#sar -f sadc-collection -tS | less

10:08:52 AM kbswpfree kbswpused  %swpused  kbswpcad   %swpcad
10:08:53 AM  73518708   2750852      3.61   1934976     70.34
10:08:54 AM  73518732   2750828      3.61   1934952     70.34
10:08:55 AM  73518732   2750828      3.61   1934952     70.34
10:08:56 AM  73518732   2750828      3.61   1934952     70.34
10:08:57 AM  73518732   2750828      3.61   1934952     70.34
10:08:58 AM  73518732   2750828      3.61   1934952     70.34
10:08:59 AM  73518732   2750828      3.61   1934952     70.34
10:09:00 AM  73518732   2750828      3.61   1934952     70.34
10:09:01 AM  73518732   2750828      3.61   1934952     70.34
10:09:02 AM  73518732   2750828      3.61   1934952     70.34
10:09:03 AM  73518732   2750828      3.61   1934952     70.34
10:09:04 AM  73518732   2750828      3.61   1934952     70.34
10:09:05 AM  73518732   2750828      3.61   1934952     70.34
10:09:06 AM  73518732   2750828      3.61   1934952     70.34
10:09:07 AM  73518732   2750828      3.61   1934952     70.34
10:09:08 AM  73555980   2713580      3.56   1897704     69.93
10:09:09 AM  75101536   1168024      1.53    319540     27.36
10:09:10 AM  74124364   2145196      2.81   1094992     51.04
10:09:12 AM  73117892   3151668      4.13   1923652     61.04
10:10:01 AM  73300560   2969000      3.89   1924316     64.81
10:10:08 AM  73300588   2968972      3.89   1924392     64.82
10:10:10 AM  73300604   2968956      3.89   1924452     64.82
10:10:14 AM  73305084   2964476      3.89   1939308     65.42
10:10:15 AM  73307916   2961644      3.88   1949096     65.81
10:10:16 AM  73309460   2960100      3.88   1960728     66.24

      Hardly 4% of swap space has been used :(

  • Changing the  vm_overcommit parameters values does not make any diffrence and system fails to utilize the swap space.
  • memory hogger program is eating  memory so fast so is there a 'timing' issue in writing data too fast to swap partition causing system total inability to perform further paging at all ?

Environment

  • Red Hat Enterprise Linux 6.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content