jq parses each input value completely into memory before running the filter. A multi-gigabyte JSON array therefore needs several times its size in RAM and often ends in the process being killed, even for a filter that only reads one field.
Two mechanisms avoid it. For a file that is a stream of separate JSON values, one per line or simply concatenated, jq already processes them one at a time, and 'jq -n "inputs | .field"' with '-n' plus the inputs builtin makes that explicit while keeping constant memory. Notably, '-s' does the opposite by slurping every input into one array, so adding '-s' out of habit reintroduces the problem.
For a single enormous document, '--stream' converts it into a sequence of path and value pairs, such as [["items",0,"id"],42], which can be filtered without materialising the whole structure. Combining '--stream' with 'fromstream(inputs)' and a truncation such as 'truncate_stream' rebuilds only the subtrees you want. The syntax is awkward, and for repeated work over very large files a purpose-built streaming tool is usually a better answer than a complex jq stream filter.