系统错误.代码:8. 没有足够的存储空间来处理此命令 [英] System Error. Code: 8. Not enough storage is available to process this command
问题描述
我们有一些 Win32 应用程序(在 Delphi 2006 中编码),有时用户会收到一条错误消息说系统错误.代码:8.没有足够的存储空间来处理此命令.".
We have a few Win32 applications (coded in Delphi 2006) where sometimes the user gets an error message saying "System Error. Code: 8. Not enough storage is available to process this command.".
从堆栈跟踪看起来它总是在 CreateWnd 调用期间
From the stacktrace it looks like it is always during CreateWnd call
Main ($1edc):
004146cc +070 app.exe SysUtils RaiseLastOSError
00414655 +005 app.exe SysUtils RaiseLastOSError
004ce44c +130 app.exe Controls TWinControl.CreateWnd
00535a72 +022 app.exe cxControls TcxControl.CreateWnd
004ce82a +016 app.exe Controls TWinControl.CreateHandle
00553d21 +005 app.exe cxContainer TcxContainer.CreateHandle
00586ef1 +005 app.exe cxEdit TcxCustomEdit.CreateHandle
005c331d +005 app.exe cxDropDownEdit TcxCustomDropDownEdit.CreateHandle
004ceaf0 +074 app.exe Controls TWinControl.UpdateShowing
004ceb1e +0a2 app.exe Controls TWinControl.UpdateShowing
004cebdc +03c app.exe Controls TWinControl.UpdateControlState
004d118a +026 app.exe Controls TWinControl.CMVisibleChanged
004cb713 +2bb app.exe Controls TControl.WndProc
004cf569 +499 app.exe Controls TWinControl.WndProc
004b727d +4c1 app.exe Forms TCustomForm.WndProc
004cb3a0 +024 app.exe Controls TControl.Perform
004c9f6a +026 app.exe Controls TControl.SetVisible
004b6c46 +03a app.exe Forms TCustomForm.SetVisible
004baf1b +007 app.exe Forms TCustomForm.Show
004bb151 +14d app.exe Forms TCustomForm.ShowModal
007869c7 +0d3 app.exe UfrmPrice 770 +19 TfrmPrice.EditPrice
0078655d +009 app.exe UfrmPrice 628 +0 TfrmPrice.actNewBidExecute
00431ce7 +00f app.exe Classes TBasicAction.Execute
004c2cb5 +031 app.exe ActnList TContainedAction.Execute
004c397c +050 app.exe ActnList TCustomAction.Execute
00431bb3 +013 app.exe Classes TBasicActionLink.Execute
004af384 +090 app.exe Menus TMenuItem.Click
004b059f +013 app.exe Menus TMenu.DispatchCommand
004b16fe +082 app.exe Menus TPopupList.WndProc
004b164d +01d app.exe Menus TPopupList.MainWndProc
004329a8 +014 app.exe Classes StdWndProc
7e4196b2 +00a USER32.dll DispatchMessageA
004bea60 +0fc app.exe Forms TApplication.ProcessMessage
004bea9a +00a app.exe Forms TApplication.HandleMessage
004becba +096 app.exe Forms TApplication.Run
008482c5 +215 app.exe AppName 129 +42 initialization
我一直无法弄清楚导致这种情况的原因,因为这种情况很少发生,我没有担心过,但我想找出导致它的原因并希望纠正它...
I've never been able to get to the bottom of what causes this and as it happens fairly seldom I haven't been to concerned, but I would like to find out what causes it and hopefully rectify it...
完整的堆栈跟踪
编辑 2: 更多信息... 今天遇到这种情况的客户已经安装了我的应用程序大约 4 个月,并且它每天在他的 PC 上运行 8 小时.该问题仅在今天出现并不断重新出现,即使他杀死了我的应用程序并重新启动它.他系统上的其他应用程序都没有表现异常.重新启动后,问题完全消失.这是否指向史蒂夫提到的堆短缺?
EDIT 2: More info... The client who experienced this today has had my app installed for about 4 months and it is running on his PC 8 hours a day. The problem only appeared today and kept reappearing even though he killed my app and restarted it. None of the other apps on his system behaved strangely. After a reboot the problem goes away completely. Does this point towards the heap shortage that Steve mentions?
编辑 3: 有趣的 msdn 博客文章 此处 和此处 关于桌面堆的主题.虽然我不确定这是否是问题的原因,但看起来很有可能.
EDIT 3: Interesting msdn blog post here and here on the topic of the desktop heap. Though I'm not sure whether this is the cause of the problem it certainly looks likely.
推荐答案
如果您的程序使用大量 Windows 资源,则可能是资源堆短缺.
If your program uses a lot of windows resources it could be a Resource Heap shortage.
可以增加一个注册表项以增加 XP 的堆大小.对于 Vista,Microsoft 已将默认值设置得更高.我建议将默认的 3072 更改为至少 8192.
There is a registry entry that can be increased to raise the heap size for XP. For Vista Microsoft already sets the default value higher. I recommend changing the default 3072 to at least 8192.
此信息记录在 MS 知识库(或搜索内存不足").可以在文章 KB184802 中找到有关参数值的其他详细信息.
This information is documented in the MS Knowledge Base (or search for "Out of Memory"). Additional details concerning the parameter values may be found in article KB184802.
我建议您阅读知识库文章,但有关更改的基本信息是:
I suggest you read the knowledgebase article but the basic info on the change is:
运行注册表编辑器 (REGEDT32.EXE).
Run Registry Editor (REGEDT32.EXE).
从 HKEY_LOCAL_MACHINE 子树,转到以下键:
From the HKEY_ LOCAL_MACHINE subtree, go to the following key:
SystemCurrentControlSetControlSession ManagerSubSystem
双击屏幕右侧的键:
On the right hand side of the screen double-click on the key:
windows
在弹出窗口中,您将看到一个很长的字段被选中.将光标移动到字符串的开头附近寻找这个(值可能会有所不同):
On the pop-up window you will see a very long field selected. Move the cursor near the beginning of the string looking for this (values may vary):
SharedSection=1024,3072,512
SharedSection 使用以下格式指定系统和桌面堆:SharedSection=xxxx,yyyy,zzz
其中 xxxx
定义系统范围的最大大小堆(以千字节为单位),yyyy
定义每个桌面堆的大小,zzz
定义非交互式"窗口站的桌面堆大小.
SharedSection specifies the System and desktop heaps using the following format: SharedSection=xxxx,yyyy,zzz
where xxxx
defines the maximum size of the system-wide heap (in kilobytes), yyyy
defines the size of the per desktop heap, and zzz
defines the size of the desktop heap for a "non-interactive" window station.
仅将 yyyy
值更改为 8192(或更大),然后按 OK.
Change ONLY the yyyy
value to 8192 (or larger) and press OK.
退出注册表编辑器并重新启动 PC 以使更改生效.
Exit the Registry Editor and reboot the PC for the change to take effect.
祝你好运.
这篇关于系统错误.代码:8. 没有足够的存储空间来处理此命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!