Skip to content

Any way to to turn console into fully synchronous? #11568

Description

@litmit

With Node.js possible to write nice small an reliable fast synchronous console applications using Javascript.

But these applications may consume all available memory and crash with
message FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory.
After investigation was founded cause of crash - console.log()
See also #3524 for details.

With Node 4.x console.log() worked in synchronous mode when stdout redirected to file, therefore this problem has workaround, but not with Node 6.x (and this not described in doc https://nodejs.org/api/console.html#console_asynchronous_vs_synchronous_consoles)

Please, add feature which allow to turn console into fully synchronous mode!
This may be command line option (--console-sync) or API call like console.mode('sync') or something else.

Without this it very hard to debug a synchronous application using console.log() or console.error() when an application generate a tons of output.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    consoleIssues and PRs related to the console subsystem.questionIssues asking questions about Node.js.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions