Node.js(和Chrome V8)中的内存限制 [英] memory limit in Node.js (and chrome V8)

查看:146
本文介绍了Node.js(和Chrome V8)中的内存限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在网络上的许多地方,您都会看到:

In many places in the web, you will see:

节点进程的内存限制是多少?

What is the memory limit on a node process?

和答案:

当前,默认情况下,V8在32位系统上的内存限制为512mb,在64位系统上的内存限制为1gb.可以通过将--max-old-space-size设置为最大〜1gb(32位)和〜1.7gb(64位)来提高此限制,但是建议您将单个进程拆分为多个工作进程如果您要达到内存限制.

Currently, by default V8 has a memory limit of 512mb on 32-bit systems, and 1gb on 64-bit systems. The limit can be raised by setting --max-old-space-size to a maximum of ~1gb (32-bit) and ~1.7gb (64-bit), but it is recommended that you split your single process into several workers if you are hitting memory limits.

有人可以确认是因为Node.js似乎经常更新吗?

更重要的是,在不久的将来会发生这种情况吗?

我想编写JavaScript代码,该代码可能必须处理4gb的javascript对象(并且速度可能不是问题).

I want to write JavaScript code which might have to deal with 4gb of javascript objects (and speed might not be an issue).

如果我无法在Node中执行此操作,最终我将在Java(在64位计算机上)执行操作,但是我宁愿不这样做.

If I can't do it in Node, I will end up doing in java (on a 64bit machine) but I would rather not.

推荐答案

对于某些使用Node.js的人来说,这是一个很大的问题,并且有个好消息. V8的新内存限制现在未知(未经测试),适用于64位,并且已提高到32位环境中允许的32位地址空间.

This has been a big concern for some using Node.js, and there are good news. The new memory limit for V8 is now unknown (not tested) for 64bit and raised to as much as 32bit address space allows in 32bit environments.

在此处了解更多信息: http://code.google.com/p/v8/issues/detail?id = 847

Read more here: http://code.google.com/p/v8/issues/detail?id=847

这篇关于Node.js(和Chrome V8)中的内存限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆