Visual C 的问题2010(Express)外部工具命令

发布于 2024-09-04 13:16:46 字数 345 浏览 0 评论 0原文

我在 SuperUser 上发布了这个...但我希望 SO 的专业人士也可能对如何解决这个问题有一个好主意...

通常我们在 VS 2005 Pro 中开发,但我想尝试一下 VS 2010 。我们有基于 GNU make 工具的自定义构建工具,在创建可执行文件时会调用这些工具。

这是我每次调用外部工具时都会看到的错误:

...\gnu\make.exe): ***无法为 cygwin 堆提交内存,Win32 错误 487

需要注意的是,它仍然可以完美地工作VS2005,以及直接从命令行调用。另外,我的外部工具的设置与 VS 2005 中的设置完全相同。

是否有某些设置可能导致引发此错误?

I posted this on SuperUser...but I was hoping the pros here at SO might have a good idea about how to fix this as well....

Normally we develop in VS 2005 Pro, but I wanted to give VS 2010 a spin. We have custom build tools based off of GNU make tools that are called when creating an executable.

This is the error that I see whenever I call my external tool:

...\gnu\make.exe): *** couldn't commit memory for cygwin heap, Win32 error 487

The caveat is that it still works perfectly fine in VS2005, as well as being called straight from the command line. Also, my external tool is setup exactly the same as in VS 2005.

Is there some setting somewhere that could cause this error to be thrown?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

客…行舟 2024-09-11 13:16:46

来自堆问题,win32错误487

每个 Cygwin 应用程序都有一个特殊的堆
保存继承的东西的区域
到子进程。例如。所有文件
描述符结构存储在
该堆区域(称为“cygheap”)。
cygheap 至少可容纳 4000 人
文件描述符结构。但 -
这就是线索——它的大小是固定的。这
cygheap 无法增长。它的尺寸是
在应用程序启动时保留
它的块已提交
需求。

由于某种原因你的服务器
应用程序需要所有 cygheap
在所描述的下运行时的空间
条件。

可能的解决方案可以在 更改 Cygwin 的最大内存中找到:

Cygwin 的堆是可扩展的。然而,
它确实以固定大小开始,并且
尝试扩展它可能会遇到
以前的记忆
由 Windows 分配。在某些情况下,
这个问题可以通过添加来解决
中的一个条目
HKEY_LOCAL_MACHINE(更改
所有用户的限制)或
HKEY_CURRENT_USER(仅用于
当前用户)注册表部分。

添加 DWORD 值 heap_chunk_in_mb
并将其设置为所需的内存限制
以十进制 MB 为单位。最好做
在 Cygwin 中使用 regtool
Cygwin 中包含的程序
包裹。 (有关更多信息
regtool 或其他 Cygwin 实用程序,
请参阅“Cygwin
实用程序”或使用 --help 选项
每个实用程序。)你应该永远是
使用 regtool 时要小心,因为
损坏您的系统注册表可能会
导致系统无法使用。这
示例将内存限制设置为 1024 MB:

regtool -i set /HKLM/Software/Cygwin/heap_chunk_in_mb 1024
regtool -v 列表 /HKLM/Software/Cygwin

退出所有正在运行的 Cygwin 进程并
重新启动它们。可以分配内存
最大为系统交换区的大小
空间减去任何的大小
正在运行的进程。系统交换
应至少与
物理安装的 RAM,可以
在系统类别下修改
控制面板。

确保 Windows 交换文件的最大大小足够大不会有什么坏处。

总结一下:环境没有为 cygwin 可执行文件分配足够的堆空间。由于某种原因,VS2010 Express 中的问题更为严重。您需要修复环境,或者使用 cygwin 之外的其他 Linux 端口,或者使用 Microsoft 实用程序。

From problem with heap, win32 error 487 :

Each Cygwin app gets a special heap
area to hold stuff which is inherited
to child processes. Eg. all file
descriptor structures are stored in
that heap area (called the "cygheap").
The cygheap has room for at least 4000
file descriptor structures. But -
that's the clue - it's fixed size. The
cygheap can't grow. It's size is
reserved at the application's start
and it's blocks are commited on
demand.

For some reason your server
application needs all the cygheap
space when running under the described
conditions.

A possible solution might be found in Changing Cygwin's Maximum Memory:

Cygwin's heap is extensible. However,
it does start out at a fixed size and
attempts to extend it may run into
memory which has been previously
allocated by Windows. In some cases,
this problem can be solved by adding
an entry in the either the
HKEY_LOCAL_MACHINE (to change the
limit for all users) or
HKEY_CURRENT_USER (for just the
current user) section of the registry.

Add the DWORD value heap_chunk_in_mb
and set it to the desired memory limit
in decimal MB. It is preferred to do
this in Cygwin using the regtool
program included in the Cygwin
package. (For more information about
regtool or the other Cygwin utilities,
see the section called “Cygwin
Utilities” or use the --help option of
each util.) You should always be
careful when using regtool since
damaging your system registry can
result in an unusable system. This
example sets memory limit to 1024 MB:

regtool -i set /HKLM/Software/Cygwin/heap_chunk_in_mb 1024
regtool -v list /HKLM/Software/Cygwin

Exit all running Cygwin processes and
restart them. Memory can be allocated
up to the size of the system swap
space minus any the size of any
running processes. The system swap
should be at least as large as the
physically installed RAM and can be
modified under the System category of
the Control Panel.

It wouldn't hurt to ensure that the maximum size of your windows swap file is large enough.

To summerize : The environment doesn't allocate enough heap space for the cygwin executables. For some reason the problem is more acute with VS2010 Express. You need to either fix the environment, or use another Linux port than cygwin, or use Microsoft utilities.

将军与妓 2024-09-11 13:16:46

从 cygwin 电子邮件列表 看起来其他人已经运行遇到类似的情况,即使不通过 Visual Studio 运行,他们发现解决方案通常是使用 Cygwin 的最大内存设置:

http://www.cygwin.com/cygwin-ug-net/setup-maxmem.html

(注意:值得 阅读此对话,从上面开始,了解一些有效和无效的价值观)。

其他人还报告了防病毒软件的问题(建议出于某种原因从内存中卸载),并且可能还有兼容性设置(尝试将其设置为 XP),这在某些情况下可能会影响 cygwin。请参阅:http://www.avrfreaks.net/ index.php?name=PNphpBB2&file=viewtopic&p=377066

至于 Visual Studio:您是否使用 64 位计算机,如果是,您通常是否在 64 位环境中运行该工具?

我发现,由于 Visual Studio 2010 以 32 位运行,因此从它启动的工具将作为 32 位进程启动(为了更好地说明这一点,请添加“cmd”作为工具)。我不确定为什么这在 2005 年不会受到影响(除非 2005 年让系统启动该进程(64 位),而 2010 年让系统自行处理它(32 位))。

From the cygwin email lists it looks like other people have run into similar situations, even when not running via Visual Studio, to which they've found that the solution is often to play with Cygwin's maximum memory settings:

http://www.cygwin.com/cygwin-ug-net/setup-maxmem.html

(note: it's worth reading this conversation, from above, about some values that did and didn't work).

Others have also reported issues with Anti-Virus software (recommendation is to unload from memory for some reason), and possibly also compatibility settings (try with it set to XP) which can affect cygwin in certain cases. See: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=377066

As for Visual Studio: Are you on a 64bit machine and if so are you usually running the tool in a 64bit environment?

I've found that because Visual Studio 2010 runs in 32bit, tools launched from it are launched as 32bit processes (for a good illustration of this, add "cmd" as a tool). I'm not sure why this wouldn't be affected on 2005 (unless 2005 lets the system launch the process (64bit) and 2010 handles it itself (32bit)).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文