home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] Machine becomes unresponsive when allocated large amounts of memory

  • Subject: Re: [OCLUG-Tech] Machine becomes unresponsive when allocated large amounts of memory
  • From: Robert Brockway <rbrockway [ at ] opentrend [ dot ] net>
  • Date: Tue, 14 Feb 2006 02:06:54 -0500 (EST)
On Sun, 12 Feb 2006, tiller man wrote:

The amount of memory I am allocating is almost certainly larger than the amount of physical memory that the machine has available. Not being a linux expert, I assumed that the machine would be able to handle this fairly gracefully through virtual memory allocation. But it doesn't.

There has been long debate over how to handle this condition. The end result has been a configurable solution! :)

The reason this is not as simple as it first sounds is that some apps go and ask for far more virtual memory than they will ever actually use. Refusing them the ability to do this may bring the app crashing down when there is no need to do so (OTOH just allocating gobs of swap will solve this problem also but could be a waste of disk space).

Use "sysctl vm.overcommit_memory" to see what the current strategy is. I suggest setting it to be strategy 2 (it is almost certainly set to be 0):

sudo sysctl -w vm.overcommit_memory=2

Rerun you tests and see what happens.

See Documentation/vm/overcommit-accounting for more explanation.


Robert Brockway B.Sc.        Phone:          +1-905-821-2327
Senior Technical Consultant  Urgent Support: +1-416-669-3073
OpenTrend Solutions Ltd      Email:          support [ at ] opentrend [ dot ] net
                             Web:            www.opentrend.net
We are open 24x365 for technical support.  Call us in a crisis.