Ben Noordhuis
570e4be932
zlib: reduce memory consumption, release early
In zlibBuffer(), don't wait for the garbage collector to reclaim the zlib memory
but release it manually. Reduces memory consumption by a factor of 10 or more
with some workloads.
Test case:
function f() {
require('zlib').deflate('xxx', g);
}
function g() {
setTimeout(f, 5);
}
f();
Observe RSS memory usage with and without this commit. After 10,000 iterations,
RSS stabilizes at ~35 MB with this commit. Without, RSS is over 300 MB and keeps
growing.
Cause: whenever the JS object heap hits the high-water mark, the V8 GC sweeps
it clean, then tries to grow it in order to avoid more sweeps in the near
future. Rule of thumb: the bigger the JS heap, the lazier the GC can be.
A side effect of a bigger heap is that objects now live longer. This is harmless
in general but it affects zlib context objects because those are tied to large
buffers that live outside the JS heap, on the order of 16K per context object.
Ergo, don't wait for the GC to reclaim the memory - it may take a long time.
Fixes #4172 .
12 years ago
isaacs
21c741f257
Print warning when maxTickDepth is reached
12 years ago
isaacs
54e88b3d61
Now working on 0.8.15
13 years ago
isaacs
b00527fcf0
2012.10.25, Version 0.8.14 (Stable)
* events: Don't clobber pre-existing _events obj in EE ctor (isaacs)
13 years ago
isaacs
648e38771e
Now working on 0.8.14
13 years ago
isaacs
ff4c974873
2012.10.25, Version 0.8.13 (Stable)
* V8: Upgrade to 3.11.10.25
* npm: Upgrade to 1.1.65
* url: parse hostnames that start with - or _ (Ben Noordhuis)
* repl: Fix Windows 8 terminal issue (Bert Belder)
* typed arrays: use signed char for signed int8s (Aaron Jacobs)
* crypto: fix bugs in DiffieHellman (Ben Noordhuis)
* configure: turn on VFPv3 on ARMv7 (Ben Noordhuis)
* Re-enable OpenSSL UI for entering passphrases via tty (Ben Noordhuis)
* repl: ensure each REPL instance gets its own "context" (Nathan Rajlich)
13 years ago
isaacs
78dbb15858
Now working on v0.9.4
13 years ago
isaacs
1ed4c6776e
2012.10.24, Version 0.9.3 (Unstable)
* V8: Upgrade to 3.13.7.4
* crypto: Default to buffers instead of binary strings (isaacs, Fedor Indutny)
* crypto: add getHashes() and getCiphers() (Ben Noordhuis)
* unix: add custom thread pool, remove libeio (Ben Noordhuis)
* util: make `inspect()` accept an "options" argument (Nathan Rajlich)
* https: fix renegotation attack protection (Ben Noordhuis)
* cluster: make 'listening' handler see actual port (Aaditya Bhatia)
* windows: use USERPROFILE to get the user's home dir (Bert Belder)
* path: add platform specific path delimiter (Paul Serby)
* http: add response.headersSent property (Pavel Lang)
* child_process: make .fork()'d child auto-exit (Ben Noordhuis)
* events: add 'removeListener' event (Ben Noordhuis)
* string_decoder: Add 'end' method, do base64 properly (isaacs)
* buffer: include encoding value in exception when invalid (Ricky Ng-Adam)
* http: make http.ServerResponse no longer emit 'end' (isaacs)
* streams: fix pipe is destructed by 'end' from destination (koichik)
13 years ago
isaacs
1122e3af28
crypto: Style. Prefer 'char*' over 'char *'
13 years ago
isaacs
f2fa97f178
crypto: Remove many unnecessary toObjects
13 years ago
isaacs
c87b524c5f
crypto: Clean up buffer handling and DH methods
13 years ago
isaacs
bfb9d5bbe6
crypto: Binding only accepts buffers
13 years ago
Aaron Jacobs
49f0f618a9
typed arrays: use `signed char` for signed int8s
The C standard allows plain `char` to be unsigned. The build environment
at Google trips this issue.
13 years ago
Ben Noordhuis
844a0058d0
crypto: fix DH use-after-free and memory leak
Fix a use-after-free bug and a memory leak in the error path of
DiffieHellman::ComputeSecret().
* the BIGNUM key was used after being freed with BN_free().
* the output buffer was not freed
13 years ago
Ben Noordhuis
de18e29784
crypto: fix DH 1 byte buffer underflow
Passing a bad key to DiffieHellman::ComputeSecret() made it zero the byte
before the heap allocated buffer due to an erroneous size calculation.
13 years ago
Ben Noordhuis
cb6d084d35
node: update description of --print
13 years ago
Dean McNamee
47643d2ec5
typed arrays: remove unnecessary special-casing
Uint32Value() on undefined is equal to 0, no need to special case it.
13 years ago
Dean McNamee
93efc7f78d
typed arrays: simplify typed array get() and set()
Instead of duplicating V8's logic (including clamping), just simply call into
V8's Get() and Set() methods, which handles all conversions and typing.
13 years ago
Ben Noordhuis
14a6c4efb8
crypto: add crypto.getHashes()
13 years ago
Ben Noordhuis
f53441ab1f
crypto: add crypto.getCiphers()
Returns a list of, unsurprisingly, the available ciphers.
13 years ago
isaacs
58db21e6c5
Now working on 0.8.13
13 years ago
isaacs
38c72d4e29
2012.10.12, Version 0.8.12 (Stable)
* npm: Upgrade to 1.1.63
* crypto: Reduce stability index to 2-Unstable (isaacs)
* windows: fix handle leak in uv_fs_utime (Bert Belder)
* windows: fix application crashed popup in debug version (Bert Belder)
* buffer: report proper retained size in profiler (Ben Noordhuis)
* buffer: fix byteLength with UTF-16LE (koichik)
* repl: make "end of input" JSON.parse() errors throw in the REPL (Nathan Rajlich)
* repl: make invalid RegExp modifiers throw in the REPL (Nathan Rajlich)
* http: handle multiple Proxy-Authenticate values (Willi Eggeling)
13 years ago
Ben Noordhuis
6a128e037e
buffer: report proper retained size in profiler
Make buffers report the proper retained size in heap snapshots.
Before this commit, Buffer objects would show up in the heap profiler as being
only a few hundred bytes large, even if the actual buffer was many megabytes.
13 years ago
Ben Noordhuis
eec8c2edaf
crypto: fix -Wtautological-compare warning
13 years ago
Andrew Paprocki
8c5f269f90
Fix -Wsizeof-array-argument compiler warning.
13 years ago
koichik
fbb0ee6f24
buffer: fix byteLength with UTF-16LE
Fixes #4075 .
13 years ago
Ben Noordhuis
109f8e2773
node_http_parser: fix whitespace errors
13 years ago
isaacs
9877b8f414
Now working on 0.8.12
13 years ago
isaacs
e1f39468fa
2012.09.27, Version 0.8.11 (Stable)
* fs: Fix stat() size reporting for large files (Ben Noordhuis)
13 years ago
Ben Noordhuis
ec03c47c19
fs: fix stat() reporting for large files
Use Number::New(), not Integer::New(). Large values won't fit in an Integer.
Apply to the size, ino and blocks fields.
13 years ago
isaacs
37869f1c9a
Now working on 0.8.11
13 years ago
isaacs
0bc273da4f
2012.09.25, Version 0.8.10 (Stable)
* npm: Upgrade to 1.1.62
* repl: make invalid RegExps throw in the REPL (Nathan Rajlich)
* v8: loosen artificial mmap constraint (Bryan Cantrill)
* process: fix setuid() and setgid() error reporting (Ben Noordhuis)
* domain: Properly exit() on domain disposal (isaacs)
* fs: fix watchFile() missing deletion events (Ben Noordhuis)
* fs: fix assert in fs.watch() (Ben Noordhuis)
* fs: don't segfault on deeply recursive stat() (Ben Noordhuis)
* http: Remove timeout handler when data arrives (Frédéric Germain)
* http: make the client "res" object gets the same domain as "req" (Nathan Rajlich)
* windows: don't blow up when an invalid FD is used (Bert Belder)
* unix: map EDQUOT to UV_ENOSPC (Charlie McConnell)
* linux: improve /proc/cpuinfo parser (Ben Noordhuis)
* win/tty: reset background brightness when color is set to default (Bert Belder)
* unix: put child process stdio fds in blocking mode (Ben Noordhuis)
* unix: fix EMFILE busy loop (Ben Noordhuis)
* sunos: don't set TCP_KEEPALIVE (Ben Noordhuis)
* tls: Use slab allocator for memory management (Fedor Indutny)
* openssl: Use optimized assembly code for x86 and x64 (Bert Belder)
13 years ago
Ben Noordhuis
17ef062db1
handle_wrap: don't abort if wrap == NULL
After a disconnect, the internal pointer of the parent/child channel is set to
NULL. That's not an error so don't abort().
13 years ago
Fedor Indutny
63ff449d87
crypto: bring module into modern age
Introduce 'buffer' encoding, allow returning and giving buffers as
arguments of 'crypto' routines.
Fix #3278
13 years ago
isaacs
d406a8250f
Now working on v0.9.3
13 years ago
isaacs
6e20558890
2012.09.17, Version 0.9.2 (Unstable)
* http_parser: upgrade to ad3b631
* openssl: upgrade 1.0.1c
* darwin: use FSEvents to watch directory changes (Fedor Indutny)
* unix: support missing API on NetBSD (Shigeki Ohtsu)
* unix: fix EMFILE busy loop (Ben Noordhuis)
* windows: un-break writable tty handles (Bert Belder)
* windows: map WSAESHUTDOWN to UV_EPIPE (Bert Belder)
* windows: make spawn with custom environment work again (Bert Belder)
* windows: map ERROR_DIRECTORY to UV_ENOENT (Bert Belder)
* tls, https: validate server certificate by default (Ben Noordhuis)
* tls, https: throw exception on missing key/cert (Ben Noordhuis)
* tls: async session storage (Fedor Indutny)
* installer: don't install header files (Ben Noordhuis)
* buffer: implement Buffer.prototype.toJSON() (Nathan Rajlich)
* buffer: added support for writing NaN and Infinity (koichik)
* http: make http.ServerResponse emit 'end' (Ben Noordhuis)
* build: ./configure --ninja (Ben Noordhuis, Timothy J Fontaine)
* installer: fix --without-npm (Ben Noordhuis)
* cli: make -p equivalent to -pe (Ben Noordhuis)
* url: Go much faster by using Url class (isaacs)
13 years ago
Ben Noordhuis
96ca59fbf3
process: fix setuid() and setgid() error reporting
Zero errno before calling getgrnam_r() or getpwnam_r(). If errno had previously
been clobbered, node would report the wrong error.
13 years ago
Ben Noordhuis
db5c26e3b5
fs: fix assert in fs.watch()
Fix the following error:
FSEventWrap: Aborting due to unwrap failure at ../../src/fs_event_wrap.cc:169
It's possible and legal for a handle to be closed twice. HandleWrap::Close()
deals with that by ignoring the second close. Now FSEventWrap::Close() does
too.
Fixes #3997 .
13 years ago
Ben Noordhuis
07804c7c9a
fs: don't segfault on deeply recursive stat()
Check that the calls to Integer::New() and Date::New() succeed and bail out if
they don't.
V8 returns an empty handle on stack overflow. Trying to set the empty handle as
a property on an object results in a NULL pointer dereference in release builds
and an assert in debug builds.
Fixes #4015 .
13 years ago
Pavel Lang
7ab4a77d6f
buffer: update constructor prototype
Change Buffer::New(char*, size_t) to Buffer::New(const char*, size_t).
13 years ago
Ben Noordhuis
bec863b7de
crypto: use uv_thread_self()
13 years ago
isaacs
362189a5d3
Now working on 0.8.10
13 years ago
isaacs
b88c3902b2
2012.09.11, Version 0.8.9 (Stable)
* v8: upgrade to 3.11.10.22
* GYP: upgrade to r1477
* npm: Upgrade to 1.1.61
* npm: Don't create world-writable files (isaacs)
* windows: fix single-accept mode for shared server sockets (Bert Belder)
* windows: fix uninitialized memory access in uv_update_time() (Bert Belder)
* windows: don't throw when a signal handler is attached (Bert Belder)
* unix: fix memory leak in udp (Ben Noordhuis)
* unix: map errno ESPIPE (Ben Noordhuis)
* unix, windows: fix memory corruption in fs-poll.c (Ben Noordhuis)
* sunos: fix os.cpus() on x86_64 (Ben Noordhuis)
* child process: fix processes with IPC channel don't emit 'close' (Bert Belder)
* build: add a "--dest-os" option to force a gyp "flavor" (Nathan Rajlich)
* build: set `process.platform` to "sunos" on SunOS (Nathan Rajlich)
* build: fix `make -j` fails after `make clean` (Bearice Ren)
* build: fix openssl configuration for "arm" builds (Nathan Rajlich)
* tls: support unix domain socket/named pipe in tls.connect (Shigeki Ohtsu)
* https: make https.get() accept a URL (koichik)
* http: respect HTTP/1.0 TE header (Ben Noordhuis)
* crypto, tls: Domainify setSNICallback, pbkdf2, randomBytes (Ben Noordhuis)
* stream.pipe: Don't call destroy() unless it's a function (isaacs)
13 years ago
Ben Noordhuis
c8c638a841
buffer: change prototype of Data() and Length()
Make Buffer:Data() and Buffer::Length() accept a Value instead of an Object.
13 years ago
Ben Noordhuis
eaf1343100
crypto: remove legacy openssl compatibility code
Remove code that works around a padding bug in older versions of openssl, the
bundled version of openssl contains the bug fix.
13 years ago
Fedor Indutny
8e0c830cd0
tls: async session storage
13 years ago
Ben Noordhuis
83b1dda12f
cli: make argument to -p optional
13 years ago
Ben Noordhuis
7dfa587d18
crypto, tls: make setSNICallback() compatible with domains
13 years ago
Ben Noordhuis
7d0543c128
crypto: make pbkdf2() compatible with domains
13 years ago
Ben Noordhuis
d1eff9ab68
crypto: make randomBytes() compatible with domains
Don't execute the callback in the context of the global object.
MakeCallback() tries to apply the active domain to the callback. If the user
polluted the global object with a 'domain' property, as in the code example
below, MakeCallback() will try to apply that.
Example:
domain = {}; // missing var keyword is intentional
crypto.randomBytes(8, cb); // TypeError: undefined is not a function
Fixes #3956 .
13 years ago