December 2015
Intermediate to advanced
232 pages
5h 8m
English
Since the process thread is shared among all the clients, memory is also shared. You should avoid storing much information in memory per request because it can accumulate over concurrent clients and your process can die simply because it runs out of memory. In threaded servers, a thread usually has a separate memory limit that’s reached long before the whole server process runs out of memory, so only the thread gets terminated instead of the whole process. However, Node.js, being in a single thread, will kill the whole process. Let’s look at a common mistake where memory is overtaxed:
| | 'use strict'; |
| | |
| | var express = require('express'); |
| | var app = express(); |
| | |
| |
Read now
Unlock full access