Module Name: src
Committed By: riastradh
Date: Wed Jan 22 06:17:51 UTC 2014
Modified Files:
src/usr.bin/vndcompress: vndcompress.1
Log Message:
Document the new vndcompress -w option and nuke BUGS section.
Perhaps vndcompress and vnduncompress ought by default to choose a
limited window size (say, 8192 entries, i.e. 64k bytes, the default
MAXPHYS), and vnduncompress should fall back to an unlimited window
only if the input is nonseekable.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/vndcompress/vndcompress.1
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/vndcompress/vndcompress.1
diff -u src/usr.bin/vndcompress/vndcompress.1:1.11 src/usr.bin/vndcompress/vndcompress.1:1.12
--- src/usr.bin/vndcompress/vndcompress.1:1.11 Wed Jan 22 06:17:42 2014
+++ src/usr.bin/vndcompress/vndcompress.1 Wed Jan 22 06:17:51 2014
@@ -1,4 +1,4 @@
-.\" $NetBSD: vndcompress.1,v 1.11 2014/01/22 06:17:42 riastradh Exp $
+.\" $NetBSD: vndcompress.1,v 1.12 2014/01/22 06:17:51 riastradh Exp $
.\"
.\" Copyright (c) 2013 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -42,11 +42,13 @@
.Op Fl k Ar checkpoint-blocks
.Op Fl l Ar length
.Op Fl p Ar partial-offset
+.Op Fl w Ar winsize
.Ar image
.Ar compressed-image
.Op Ar blocksize
.Nm vnduncompress
.Op Fl d
+.Op Fl w Ar winsize
.Ar compressed-image
.Ar image
.Sh DESCRIPTION
@@ -126,6 +128,39 @@ checkpoints, or if the output file has b
recognizable ways, or if the input file's size has changed, or if the
block size does not match, and so on.
.El
+.Pp
+The following option is available for both compression and
+decompression:
+.Bl -tag -width indent
+.It Fl w Ar winsize
+Use an in-memory window of
+.Ar winsize
+entries into the table of compressed block offsets.
+If
+.Fl w
+is not supplied or
+.Ar winsize
+is zero,
+.Nm
+will use memory proportional to the number of blocks in the
+uncompressed image, namely 64 bits or 8 bytes per block.
+If
+.Ar winsize
+is nonzero,
+.Nm
+will use memory proportional to
+.Ar winsize ,
+and independent of the size of the uncompressed image.
+.Pp
+A nonzero
+.Ar winsize
+requires the compressed image to be a seekable file, which compression
+requires anyway, in order to record the offsets of compressed blocks
+once they are compressed and written, but which is a limitation for
+decompression.
+Thus, decompressing from a pipe is incompatible with a nonzero
+.Ar winsize .
+.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
@@ -215,14 +250,6 @@ The
.Nm
command first appeared in
.Nx 3.0 .
-It was rewritten to be more robust and to support restarting partial
-transfers in
+It was rewritten to be more robust, to support restarting partial
+transfers, and to support bounded memory usage in
.Nx 7.0 .
-.Sh BUGS
-The amount of memory consumed by
-.Nm
-and
-.Nm vnduncompress
-is proportional to the number of compression blocks they process,
-because they store the whole offset table in memory at once.
-Instead, they should use a limited-size window into the offset table.