0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

7256 Commits

Author SHA1 Message Date
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.
2012-10-30 15:03:17 +01:00
isaacs
21c741f257 Print warning when maxTickDepth is reached 2012-10-29 10:53:39 -07:00
Scott Blomquist
953b049a89 windows: correct outputs list in "node_etw" gyp target
The gyp target node_etw didn't list its output dependencies. This
was causing virgin builds to fail with a "failed to open file for
write" error.

With this corrected outputs list, gyp reliably pre-creates
required output directories.
2012-10-29 14:27:30 +01:00
Ben Noordhuis
9b61f570d8 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	configure
	deps/v8/build/common.gypi
2012-10-25 16:08:58 +02:00
Ben Noordhuis
4b8629db37 v8: remove optimization switches
Remove compiler switches from $(TOPLEVEL)/deps/v8/build/common.gypi, we set
them globally in $(TOPLEVEL)/common.gypi.

Commit 29d12c73 accidentally reintroduced the switches again. In particular,
the 'cflags!': ['-O2','-Os'] section forced building V8 without any
optimizations, resulting in a steep (~66%) performance drop on some benchmarks.

Fixes #4191.
2012-10-25 01:06:00 +02:00
Ben Noordhuis
28e6403a56 build: add --unsafe-optimizations configure switch
Turns on -O3 and other optimizations that may produce buggy code with some
toolchains. Use at your own risk.
2012-10-25 01:06:00 +02:00
Ben Noordhuis
de0303d3ad url: parse hostnames that start with - or _
Allow hostnames like '-lovemonsterz.tumblr.com' and '_jabber._tcp.google.com'.

Fixes #4177.
2012-10-25 01:06:00 +02:00
Bert Belder
fa94f0fe83 v8: don't show performance warnings when compiling with msvc
Patch sent upstream: http://codereview.chromium.org/10829109/
2012-10-24 21:29:46 +02:00
isaacs
78dbb15858 Now working on v0.9.4 2012-10-24 10:10:57 -07:00
isaacs
9b3f63503e Merge branch 'v0.9.3-release' 2012-10-24 10:10:30 -07:00
isaacs
82a72e9591 blog: Post for v0.9.3 release 2012-10-24 10:08:58 -07:00
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)
2012-10-24 09:21:44 -07:00
isaacs
abf37c1e66 V8 build: 'echo -n' considered harmful 2012-10-24 09:21:44 -07:00
Ben Noordhuis
8ac017eba7 test: fix pummel/test-crypto-dh, pummel/test-dh-regr
Forgotten in the switch to buffers as the default output in 3570f20.

Fixes #4188.
2012-10-24 15:37:34 +02:00
Bert Belder
f34f1e30a6 repl: call resume() after setRawMode()
Solves #4178, but does not fix the underlying issue
2012-10-24 02:52:18 +02:00
Bert Belder
6822488c93 repl: call resume() after setRawMode()
Solves #4178, but does not fix the underlying issue
2012-10-24 02:42:57 +02:00
Olivier Lalonde
626db18635 doc: child_process: document uid and gid spawn() options 2012-10-24 01:24:00 +02:00
isaacs
c3ca783525 Merge remote-tracking branch 'ry/v0.8'
Conflicts:
	deps/v8/src/arm/code-stubs-arm.cc
	deps/v8/src/version.cc
2012-10-23 11:59:19 -07:00
isaacs
a0ee291566 V8: Reapply patches 2012-10-23 11:50:46 -07:00
isaacs
95c9305874 V8: Upgrade to 3.13.7.4 2012-10-23 11:48:55 -07:00
isaacs
76a6c4bf2e V8: Reapply patches 2012-10-23 11:38:09 -07:00
isaacs
29d12c7342 V8: Upgrade to 3.11.10.25 2012-10-23 11:35:27 -07:00
isaacs
7413df0c1f npm: Upgrade to 1.1.64 2012-10-23 11:34:46 -07:00
isaacs
3570f2097f Merge branch 'crypto-buffers' 2012-10-23 11:26:06 -07:00
isaacs
1122e3af28 crypto: Style. Prefer 'char*' over 'char *' 2012-10-23 10:48:51 -07:00
isaacs
f2fa97f178 crypto: Remove many unnecessary toObjects 2012-10-23 10:48:51 -07:00
isaacs
d7da20c812 crypto: pbkdf2 throws when no callback provided 2012-10-23 10:48:51 -07:00
isaacs
f3621359f4 doc: OpenSSL is bundled now. 2012-10-23 10:48:51 -07:00
isaacs
c87b524c5f crypto: Clean up buffer handling and DH methods 2012-10-23 10:48:51 -07:00
isaacs
76b0bdf720 crypto: Add crypto.DEFAULT_ENCODING (defaults to 'buffer')
This is a flag to make it easier for users to upgrade through the
breaking crypto change, and easier for us to switch it back if it's a
problem.

Explicitly set default encoding to 'buffer' in other tests, in case it
ever changes back.
2012-10-23 10:48:51 -07:00
isaacs
4266f5cf2e tls: Provide buffer to Connection.setSession 2012-10-23 10:48:50 -07:00
isaacs
bfb9d5bbe6 crypto: Binding only accepts buffers 2012-10-23 10:48:50 -07:00
isaacs
9901b69c8e crypto: Move encoding logic to JS, default=buffer
crypto: Hash and Hmac default to buffers

crypto: Move Cipher encoding logic to JS

crypto: Move Cipheriv encoding logic to JS

crypto: Move Decipher encoding logic to JS

crypto: Move Decipheriv into JS, default to buffers

crypto: Move Sign class to JS

crypto: Better encoding handling in Hash.update

crypto: Move Verify class to JS

crypto: Move DiffieHellman to JS, default to buffers

crypto: Move DiffieHellmanGroup to JS, default to buffers

Also, create a test for this feature
2012-10-23 10:22:42 -07:00
Ben Noordhuis
160e4d0534 build: re-enable gdbjit, honor --gdb again
Note that you need to start node with --gdbjit for it to become effective.
2012-10-23 17:43:38 +02:00
mstarzinger@chromium.org
e8b0427be2 v8: make GDBJIT interface compile again
R=ulan@chromium.org
BUG=v8:1804

Review URL: https://codereview.chromium.org/11022007

This is a back-port of upstream commits 12679, 12686 and 12738.
2012-10-23 17:42:43 +02:00
isaacs
18beea4a3f Merge remote-tracking branch 'ry/v0.8' 2012-10-23 08:22:47 -07:00
Ben Noordhuis
b6b881378a test: add typed arrays regression test
Ensure that uint8 values >= 128 are correctly promoted to int8 <= -1.
2012-10-23 17:12:39 +02:00
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.
2012-10-23 16:55:59 +02:00
yangguo@chromium.org
9fa953d3e7 v8: use correct timezone information on Solaris
`timezone` variable contains the difference, in seconds, between UTC and
local standard time (see `man 3 localtime` on Solaris).

Call to `tzset` is required to apply contents of `TZ` variable to
`timezone` variable.

BUG=v8:2064

Review URL: https://chromiumcodereview.appspot.com/10967066
Patch from Maciej Małecki <me@mmalecki.com>.

This is a back-port of upstream commit r12802.
2012-10-23 16:43:38 +02:00
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
2012-10-22 00:20:45 +02:00
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.
2012-10-22 00:20:32 +02:00
Ben Noordhuis
82df345fbb test: add diffie-hellman regression test
Exercises the error path in DiffieHellman::ComputeSecret() in src/node_crypto.cc
2012-10-21 23:56:01 +02:00
Ben Noordhuis
d0227b0308 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	deps/openssl/openssl.gyp
2012-10-21 23:06:48 +02:00
Soarez
72ce9baa75 streams: remove useless line
The removed line was removing a calllback that was never setup
in first place. 016afe2 forgot to remove this.
2012-10-21 22:58:14 +02:00
Ben Noordhuis
cb6d084d35 node: update description of --print 2012-10-20 15:03:48 +02:00
Bert Belder
c11c19b92c uv: upgrade to 1e32cb0 2012-10-17 18:33:45 +02:00
isaacs
627f0d27e8 doc: Typo. s/arguemnt/argument/ 2012-10-16 10:59:23 -07:00
Nathan Rajlich
cca15e8e33 test: disable global variable check for "test-repl-options.js"
Previously, the "global" mode of REPLs was broken when created after another
non-global REPL (they would end up sharing the same context). Now that "global"
mode is fixed for that case (b1e78cef09), this
test case gets its global scope modified with "module" and other REPL-specific
properties, so disable the global check.
2012-10-15 14:59:57 -07:00
Ben Noordhuis
1205734e69 configure: turn on VFPv3 on ARMv7
Fixes a V8 build error caused by missing arm_fpu and arm_neon settings.

This is a back-port of commit bbf6b4e from the master branch.

Fixes #4142.
2012-10-15 23:55:26 +02:00
Ben Noordhuis
28b0cc08b8 Revert "Disable OpenSSL UI"
This reverts commit 1c88c3b3b5.

It breaks the "read a password from stdin" functionality that OpenSSL provides.

Fixes #4059, #4143.

Conflicts:

	deps/openssl/openssl.gyp
2012-10-15 23:40:15 +02:00