{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/22756","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/22756/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/22756/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/22756/events","html_url":"https://github.com/nodejs/node/pull/22756","id":358205922,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0MDM1MzA0","number":22756,"title":"util: limit inspection output size to 128 MB","user":{"login":"BridgeAR","id":8822573,"node_id":"MDQ6VXNlcjg4MjI1NzM=","avatar_url":"https://avatars2.githubusercontent.com/u/8822573?v=4","gravatar_id":"","url":"https://api.github.com/users/BridgeAR","html_url":"https://github.com/BridgeAR","followers_url":"https://api.github.com/users/BridgeAR/followers","following_url":"https://api.github.com/users/BridgeAR/following{/other_user}","gists_url":"https://api.github.com/users/BridgeAR/gists{/gist_id}","starred_url":"https://api.github.com/users/BridgeAR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BridgeAR/subscriptions","organizations_url":"https://api.github.com/users/BridgeAR/orgs","repos_url":"https://api.github.com/users/BridgeAR/repos","events_url":"https://api.github.com/users/BridgeAR/events{/privacy}","received_events_url":"https://api.github.com/users/BridgeAR/received_events","type":"User","site_admin":false},"labels":[{"id":155267446,"node_id":"MDU6TGFiZWwxNTUyNjc0NDY=","url":"https://api.github.com/repos/nodejs/node/labels/util","name":"util","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-07T20:45:34Z","updated_at":"2018-09-08T06:38:58Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/22756","html_url":"https://github.com/nodejs/node/pull/22756","diff_url":"https://github.com/nodejs/node/pull/22756.diff","patch_url":"https://github.com/nodejs/node/pull/22756.patch"},"body":"While working on #19994 after my recent [performance improvements](12ed7c94e5160aa6d38e3d2cb2a73dae0a6f9342)\r\nfor `util.inspect()` I took a step back to look at the issue from a different\r\nangle again and I realized that the recursive algorithm is actually the\r\nproblem that we ran into in #19405. All parts are put together at the very\r\nend of the computation and no error will be thrown even tough the\r\nmaximum string size is long exceeded. Therefore I put together this PR:\r\n\r\n-----\r\n\r\nThe maximum hard limit that `util.inspect()` could theoretically handle\r\nis the maximum string size. That is 2 ** 28 - 2 on 32 bit systems and\r\n2 ** 30 - 16 on 64 bit systems.\r\n\r\nDue to the recursive algorithm a complex object could easily exceed\r\nthat limit without throwing an error right away and therefore\r\ncrashing the application by exceeding the heap limit.\r\n\r\n`util.inspect()` is fast enough to compute 128 MB in 250 ms on an\r\nIntel(R) Core(TM) i7-5600U CPU. This hard limit allows to inspect arbitrary\r\nbig objects from now on without crashing the application or blocking the\r\nevent loop significantly.\r\n\r\n<!--\r\nThank you for your pull request. Please provide a description above and review\r\nthe requirements below.\r\n\r\nBug fixes and new features should include tests and possibly benchmarks.\r\n\r\nContributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md\r\n-->\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] documentation is changed or added\r\n- [x] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines)\r\n"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/419617836","html_url":"https://github.com/nodejs/node/pull/22756#issuecomment-419617836","issue_url":"https://api.github.com/repos/nodejs/node/issues/22756","id":419617836,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTYxNzgzNg==","user":{"login":"BridgeAR","id":8822573,"node_id":"MDQ6VXNlcjg4MjI1NzM=","avatar_url":"https://avatars2.githubusercontent.com/u/8822573?v=4","gravatar_id":"","url":"https://api.github.com/users/BridgeAR","html_url":"https://github.com/BridgeAR","followers_url":"https://api.github.com/users/BridgeAR/followers","following_url":"https://api.github.com/users/BridgeAR/following{/other_user}","gists_url":"https://api.github.com/users/BridgeAR/gists{/gist_id}","starred_url":"https://api.github.com/users/BridgeAR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BridgeAR/subscriptions","organizations_url":"https://api.github.com/users/BridgeAR/orgs","repos_url":"https://api.github.com/users/BridgeAR/repos","events_url":"https://api.github.com/users/BridgeAR/events{/privacy}","received_events_url":"https://api.github.com/users/BridgeAR/received_events","type":"User","site_admin":false},"created_at":"2018-09-08T06:38:58Z","updated_at":"2018-09-08T06:38:58Z","author_association":"MEMBER","body":"CI https://ci.nodejs.org/job/node-test-pull-request/17082/"}}
{"actor":{"display_login":"BridgeAR"}}