Linux: DD Bytes

Create 1G file in PC with 1G of RAM:

DESCRIPTION
       Copy a file, converting and formatting according to the operands.

       bs=BYTES
              read and write up to BYTES bytes at a time (default: 512); overrides ibs and obs
dd if=/dev/zero of=./file.img bs=1G
dd: memory exhausted by input buffer of size 1073741824 bytes (1.0 GiB)

This is because the command is creating 1G of data in MEMORY before writing it to disk.

Workaround:

dd if=/dev/zero of=./file.img bs=100M count=10

This will create 100M data in memory then writing it to disk while creating the second 100M and so on.