Skip to content

Commit

Permalink
doc: use consistent abbreviation formatting
Browse files Browse the repository at this point in the history
Refs: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/bits-bytes-terms

PR-URL: #39343
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
Trott authored and targos committed Jul 13, 2021
1 parent 2573bf5 commit 64a185e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
6 changes: 3 additions & 3 deletions doc/api/buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ initialized*. The contents of the newly created `Buffer` are unknown and
such `Buffer` instances with zeroes.

When using [`Buffer.allocUnsafe()`][] to allocate new `Buffer` instances,
allocations under 4KB are sliced from a single pre-allocated `Buffer`. This
allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This
allows applications to avoid the garbage collection overhead of creating many
individually allocated `Buffer` instances. This approach improves both
performance and memory usage by eliminating the need to track and clean up as
Expand Down Expand Up @@ -5027,9 +5027,9 @@ changes:

* {integer} The largest size allowed for a single `Buffer` instance.

On 32-bit architectures, this value currently is 2<sup>30</sup> - 1 (~1GB).
On 32-bit architectures, this value currently is 2<sup>30</sup> - 1 (~1 GB).

On 64-bit architectures, this value currently is 2<sup>32</sup> (~4GB).
On 64-bit architectures, this value currently is 2<sup>32</sup> (~4 GB).

It reflects [`v8::TypedArray::kMaxLength`][] under the hood.

Expand Down
8 changes: 4 additions & 4 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,10 @@ added:
changes:
- version: v13.13.0
pr-url: https://github.com/nodejs/node/pull/32520
description: Change maximum default size of HTTP headers from 8KB to 16KB.
description: Change maximum default size of HTTP headers from 8 KB to 16 KB.
-->

Specify the maximum size, in bytes, of HTTP headers. Defaults to 16KB.
Specify the maximum size, in bytes, of HTTP headers. Defaults to 16 KB.

### `--napi-modules`
<!-- YAML
Expand Down Expand Up @@ -1758,8 +1758,8 @@ Sets the max memory size of V8's old memory section. As memory
consumption approaches the limit, V8 will spend more time on
garbage collection in an effort to free unused memory.

On a machine with 2GB of memory, consider setting this to
1536 (1.5GB) to leave some memory for other uses and avoid swapping.
On a machine with 2 GB of memory, consider setting this to
1536 (1.5 GB) to leave some memory for other uses and avoid swapping.

```console
$ node --max-old-space-size=1536 index.js
Expand Down
4 changes: 2 additions & 2 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2452,11 +2452,11 @@ changes:
- v10.15.0
commit: 186035243fad247e3955f
pr-url: https://github.com/nodejs-private/node-private/pull/143
description: Max header size in `http_parser` was set to 8KB.
description: Max header size in `http_parser` was set to 8 KB.
-->

Too much HTTP header data was received. In order to protect against malicious or
malconfigured clients, if more than 8KB of HTTP header data is received then
malconfigured clients, if more than 8 KB of HTTP header data is received then
HTTP parsing will abort without a request or response object being created, and
an `Error` with this code will be emitted.

Expand Down
4 changes: 2 additions & 2 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2962,8 +2962,8 @@ to read a complete file into memory.
The additional read overhead can vary broadly on different systems and depends
on the type of file being read. If the file type is not a regular file (a pipe
for instance) and Node.js is unable to determine an actual file size, each read
operation will load on 64kb of data. For regular files, each read will process
512kb of data.
operation will load on 64 KB of data. For regular files, each read will process
512 KB of data.

For applications that require as-fast-as-possible reading of file contents, it
is better to use `fs.read()` directly and for application code to manage
Expand Down
7 changes: 4 additions & 3 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -2677,7 +2677,7 @@ changes:
* `maxHeaderSize` {number} Optionally overrides the value of
[`--max-http-header-size`][] for requests received by this server, i.e.
the maximum length of request headers in bytes.
**Default:** 16384 (16KB).
**Default:** 16384 (16 KB).
* `requestListener` {Function}

* Returns: {http.Server}
Expand Down Expand Up @@ -2787,7 +2787,8 @@ added:
* {number}

Read-only property specifying the maximum allowed size of HTTP headers in bytes.
Defaults to 8KB. Configurable using the [`--max-http-header-size`][] CLI option.
Defaults to 8 KB. Configurable using the [`--max-http-header-size`][] CLI
option.

This can be overridden for servers and client requests by passing the
`maxHeaderSize` option.
Expand Down Expand Up @@ -2853,7 +2854,7 @@ changes:
* `maxHeaderSize` {number} Optionally overrides the value of
[`--max-http-header-size`][] for requests received from the server, i.e.
the maximum length of response headers in bytes.
**Default:** 16384 (16KB).
**Default:** 16384 (16 KB).
* `method` {string} A string specifying the HTTP request method. **Default:**
`'GET'`.
* `path` {string} Request path. Should include query string if any.
Expand Down
6 changes: 3 additions & 3 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@ If the loop terminates with a `break`, `return`, or a `throw`, the stream will
be destroyed. In other terms, iterating over a stream will consume the stream
fully. The stream will be read in chunks of size equal to the `highWaterMark`
option. In the code example above, data will be in a single chunk if the file
has less then 64KB of data because no `highWaterMark` option is provided to
has less then 64 KB of data because no `highWaterMark` option is provided to
[`fs.createReadStream()`][].

##### `readable.iterator([options])`
Expand Down Expand Up @@ -2053,7 +2053,7 @@ changes:
* `options` {Object}
* `highWaterMark` {number} Buffer level when
[`stream.write()`][stream-write] starts returning `false`. **Default:**
`16384` (16KB), or `16` for `objectMode` streams.
`16384` (16 KB), or `16` for `objectMode` streams.
* `decodeStrings` {boolean} Whether to encode `string`s passed to
[`stream.write()`][stream-write] to `Buffer`s (with the encoding
specified in the [`stream.write()`][stream-write] call) before passing
Expand Down Expand Up @@ -2416,7 +2416,7 @@ changes:
* `options` {Object}
* `highWaterMark` {number} The maximum [number of bytes][hwm-gotcha] to store
in the internal buffer before ceasing to read from the underlying resource.
**Default:** `16384` (16KB), or `16` for `objectMode` streams.
**Default:** `16384` (16 KB), or `16` for `objectMode` streams.
* `encoding` {string} If specified, then buffers will be decoded to
strings using the specified encoding. **Default:** `null`.
* `objectMode` {boolean} Whether this stream should behave
Expand Down
4 changes: 2 additions & 2 deletions doc/guides/investigating_native_memory_leak.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@ operating systems will clean up the memory of the process after the
shutdown while attempting to free all memory to get a clean
report may have a negative impact on the code complexity and
shutdown times. Node.js does a pretty good job only leaving on
the order of 6KB that are not freed on shutdown.
the order of 6 KB that are not freed on shutdown.

## An obvious memory leak

Leaks can be introduced in native addons and the following is a simple
example leak based on the "Hello world" addon from
[node-addon-examples](https://github.com/nodejs/node-addon-examples).

In this example, a loop which allocates ~1MB of memory and never frees it
In this example, a loop which allocates ~1 MB of memory and never frees it
has been added:

```cpp
Expand Down
2 changes: 1 addition & 1 deletion doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ This flag is inherited from V8 and is subject to change upstream. It may
disappear in a non-semver-major release.
.
.It Fl -max-http-header-size Ns = Ns Ar size
Specify the maximum size of HTTP headers in bytes. Defaults to 16KB.
Specify the maximum size of HTTP headers in bytes. Defaults to 16 KB.
.
.It Fl -napi-modules
This option is a no-op.
Expand Down

0 comments on commit 64a185e

Please sign in to comment.