summaryrefslogtreecommitdiff
path: root/lib/_stream_readable.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-05-16 18:10:08 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2018-09-13 10:49:04 +0200
commiteb61127c48ba59e52d7cea293ad80fa54000939c (patch)
treebac34ae84a86c310684a0148a42b6a8d71047759 /lib/_stream_readable.js
parent1cee08536794b6d7bc8d3b9ace2b494c74985f7d (diff)
downloadandroid-node-v8-eb61127c48ba59e52d7cea293ad80fa54000939c.tar.gz
android-node-v8-eb61127c48ba59e52d7cea293ad80fa54000939c.tar.bz2
android-node-v8-eb61127c48ba59e52d7cea293ad80fa54000939c.zip
util: limit inspection output size to 128 MB
The maximum hard limit that `util.inspect()` could theoretically handle is the maximum string size. That is ~2 ** 28 on 32 bit systems and ~2 ** 30 on 64 bit systems. Due to the recursive algorithm a complex object could easily exceed that limit without throwing an error right away and therefore crashing the application by exceeding the heap limit. `util.inspect()` is fast enough to compute 128 MB of data below one second on an Intel(R) Core(TM) i7-5600U CPU. This hard limit allows to inspect arbitrary big objects from now on without crashing the application or blocking the event loop significantly. PR-URL: https://github.com/nodejs/node/pull/22756 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Diffstat (limited to 'lib/_stream_readable.js')
0 files changed, 0 insertions, 0 deletions