misc/133286: dd can fill system memory

Stephen Sanders ssanders at opnet.com
Wed Apr 1 15:10:02 PDT 2009


>Number:         133286
>Category:       misc
>Synopsis:       dd can fill system memory
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 01 22:10:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Stephen Sanders
>Release:        6.3
>Organization:
OPNET
>Environment:
FreeBSD alt-4100-1.opnet.com 6.3-RELEASE FreeBSD 6.3-RELEASE #0: Tue Mar 31 18:47:07 EDT 2009     root at vm6-3-64-dev.opnet.com:/root/Projects/FreeBSD/package/NPbabkernel/bld-tmp/sys/amd64/compile/NPBAB  amd64

CPU: Intel(R) Xeon(R) CPU           X5450  @ 3.00GHz (2414.49-MHz K8-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 8 CPUs

16GB RAM
3ware 9650SE-16ML
16 750GB drives
16 GB swap


>Description:
Attempting to write very large files using the following command line leads to very sluggish behavior or sometimes the system will restart itself.  Dependent on how large the file is, one may see "out of swap" in the dmesg log.

dd if=/dev/zero of=/tmp/bigFile bs=128K count=200000

vmstat shows freemem going to 0 and swapping commences.  It would appear that the file system cache is growing without bound and/or pages are not being ejected from the cache fast enough.

Adding O_DIRECT to the opens on lines 141 and 148 of /usr/src/bin/dd/dd.c will fix this problem.

>How-To-Repeat:
Run the command :

dd if=/dev/zero of=/tmp/bigFile bs=128K count=200000

One may need to use a larger count than 200000.
>Fix:

Adding O_DIRECT to the opens on lines 141 and 148 of /usr/src/bin/dd/dd.c will fix this problem.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list