Bug 36863

Summary: Setting a virtual memory limit of 256MB causes /bin/sort to immediately fail with memory exhausted
Product: [Retired] Red Hat Linux Reporter: Henrik Grubbstrvm <grubba>
Component: textutilsAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED CURRENTRELEASE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-04-20 19:08:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Henrik Grubbstrvm 2001-04-20 17:33:05 UTC
sh-2.04$ ulimit -a
core file size (blocks)     1000000
data seg size (kbytes)      unlimited
file size (blocks)          unlimited
max locked memory (kbytes)  unlimited
max memory size (kbytes)    unlimited
open files                  1024
pipe size (512 bytes)       8
stack size (kbytes)         8192
cpu time (seconds)          unlimited
max user processes          8073
virtual memory (kbytes)     unlimited
sh-2.04$ sort
foo     
bar
baz
bar
baz
foo
sh-2.04$ ulimit -v 262144
sh-2.04$ sort
sort: memory exhausted
sh-2.04$ ulimit -a 
core file size (blocks)     1000000
data seg size (kbytes)      unlimited
file size (blocks)          unlimited
max locked memory (kbytes)  unlimited
max memory size (kbytes)    unlimited
open files                  1024
pipe size (512 bytes)       8
stack size (kbytes)         8192
cpu time (seconds)          unlimited
max user processes          8073
virtual memory (kbytes)     262144

Setting of the limit as above worked fine with the linux-2.4.0-0.43 kernel.

Comment 1 Arjan van de Ven 2001-04-20 19:07:59 UTC
this is a bug in sort; sort tries to allocate 2/3rds of physical memory 
regardless of what it is sorting

Comment 2 Bernhard Rosenkraenzer 2001-04-20 22:07:12 UTC
Used to, until we fixed it up a while before the 7.1 release.