Description
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.