test: fix pummel test out-of-memory errors
authorBen Noordhuis <info@bnoordhuis.nl>
Sun, 27 Jan 2013 21:01:10 +0000 (22:01 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Sun, 27 Jan 2013 21:01:14 +0000 (22:01 +0100)
Fix the following OOM error in pummel/test-net-connect-memleak
and pummel/test-tls-connect-memleak:

  FATAL ERROR: CALL_AND_RETRY_0 Allocation failed - process out of
  memory

Commit v8/v8@91afd39 increases the size of the deoptimization table
to the extent that a 64M float array pushes it over the brink. Switch
to SMIs so it stays below the limit.

pummel/test-net-connect-memleak is still failing albeit with a different
error this time. Needs further investigation.

  === release test-net-connect-memleak ===
  Path: pummel/test-net-connect-memleak
  -64 kB reclaimed
  assert.js:102
    throw new assert.AssertionError({
          ^
  AssertionError: false == true
      at done [as _onTimeout] (/home/bnoordhuis/src/nodejs/master/
  test/pummel/test-net-connect-memleak.js:48:3)
      at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
      at process._makeCallback (node.js:306:20)

test/pummel/test-net-connect-memleak.js
test/pummel/test-tls-connect-memleak.js

index 269acbf..c3f2daa 100644 (file)
@@ -30,7 +30,7 @@ net.createServer(function() {}).listen(common.PORT);
 
 (function() {
   // 2**26 == 64M entries
-  for (var i = 0, junk = [123.456]; i < 26; ++i) junk = junk.concat(junk);
+  for (var i = 0, junk = [0]; i < 26; ++i) junk = junk.concat(junk);
 
   net.createConnection(common.PORT, '127.0.0.1', function() {
     assert(junk.length != 0);  // keep reference alive
index 3454b6d..ceee437 100644 (file)
@@ -35,7 +35,7 @@ tls.createServer({
 
 (function() {
   // 2**26 == 64M entries
-  for (var i = 0, junk = [123.456]; i < 26; ++i) junk = junk.concat(junk);
+  for (var i = 0, junk = [0]; i < 26; ++i) junk = junk.concat(junk);
 
   var options = { rejectUnauthorized: false };
   tls.connect(common.PORT, '127.0.0.1', options, function() {