[nodejs] Memory leak with Buffer.toArrayBuffer

88 views
Skip to first unread message

Denys Khanzhyiev

unread,
May 12, 2014, 3:44:23 PM5/12/14
to nodejs
the code:

var buf = new Buffer(1024*1024);

setInterval(function(){
 var ab = buf.toArrayBuffer();
 var b = new Uint8Array(ab);
},10);


quickly eats memory and crashes node.

Invoking it every 20 or 100 ms just prolongates agony.

Originally found in Node WebKit
reproduced in node 0.11.13

Is it worth of creating issue?

Francesco Mari

unread,
May 12, 2014, 8:37:02 PM5/12/14
to nod...@googlegroups.com

It sounds like something which is better discussed in an issue in the Node.js repository.

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAP8%3DUyQUX1mm-7aihhv7uY8zM6_AOYjn7frLURf6d-5Li534UA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Sam Roberts

unread,
May 12, 2014, 8:28:30 PM5/12/14
to nod...@googlegroups.com
Node version?

I get

```
var ab = buf.toArrayBuffer();
^
TypeError: Object
```

mscdex

unread,
May 12, 2014, 9:47:37 PM5/12/14
to nod...@googlegroups.com
On Monday, May 12, 2014 3:44:23 PM UTC-4, Denys Khanzhiyev wrote:

Is it worth of creating issue?

Not really, it looks like it was just removed[1].

[1] https://github.com/joyent/node/commit/b1a44dfe9eb9297a260d584cf87af1d7b74e7d0a

Ryan Graham

unread,
May 12, 2014, 11:01:40 PM5/12/14
to nod...@googlegroups.com
For the curious, the discussion moved to https://github.com/joyent/node/issues/7609


~Ryan

Denys Khanzhyiev

unread,
May 13, 2014, 1:02:11 PM5/13/14
to nodejs
Yes It was me who started the process:


--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages