Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Apr 2009 22:08:29 GMT
From:      Stephen Sanders <ssanders@opnet.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/133286: dd can fill system memory
Message-ID:  <200904012208.n31M8TK6018668@www.freebsd.org>
Resent-Message-ID: <200904012210.n31MA1PL018141@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904012208.n31M8TK6018668>