系统错误。代码:8.没有足够的存储来处理这个命令 [英] System Error. Code: 8. Not enough storage is available to process this command

查看:193
本文介绍了系统错误。代码:8.没有足够的存储来处理这个命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有几个Win32应用程序(在Delphi 2006中编码),其中有时用户会收到一条错误消息,说系统错误。代码:8.没有足够的存储可用于处理此命令。



从stacktrace看起来它总是在CreateWnd调用

 主($ 1edc):
004146cc +070 app.exe SysUtils RaiseLastOSError
00414655 +005 app.exe SysUtils RaiseLastOSError
004ce44c +130 app.exe控件TWinControl.CreateWnd
00535a72 +022 app.exe cxControls TcxControl.CreateWnd
004ce82a +016 app.exe控件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控制TWinControl.UpdateS如何
004ceb1e + 0a2 app.exe控件TWinControl.UpdateShowing
004cebdc + 03c app.exe控件TWinControl.UpdateControlState
004d118a +026 app.exe控件TWinControl.CMVisibleChanged
004cb713 + 2bb app.exe控件TControl.WndProc
004cf569 +499 app.exe控件TWinControl.WndProc
004b727d + 4c1 app.exe表单TCustomForm.WndProc
004cb3a0 +024 app.exe控件TControl.Perform
004c9f6a +026 app.exe控件TControl.SetVisible
004b6c46 + 03a app.exe表单TCustomForm.SetVisible
004baf1b +007 app.exe表单TCustomForm.Show
004bb151 + 14d应用程序。 exe表单TCustomForm.ShowModal
007869c7 + 0d3 app.exe UfrmPrice 770 +19 TfrmPrice.EditPrice
0078655d +009 app.exe UfrmPrice 628 +0 TfrmPrice.actNewBidExecute
00431ce7 + 00f app.exe类塔斯icAction.Execute
004c2cb5 +031 app.exe ActnList TContainedAction.Execute
004c397c +050 app.exe ActnList TCustomAction.Execute
00431bb3 +013 app.exe类别TBasicActionLink.Execute
004af384 +090 app.exe菜单TMenuItem.Click
004b059f +013 app.exe菜单TMenu.DispatchCommand
004b16fe +082 app.exe菜单TPopupList.WndProc
004b164d + 01d app.exe菜单TPopupList。 MainWndProc
004329a8 +014 app.exe类StdWndProc
7e4196b2 + 00a USER32.dll DispatchMessageA
004bea60 + 0fc app.exe表单TApplication.ProcessMessage
004bea9a + 00a app.exe表单TApplication .HandleMessage
004becba +096 app.exe表单TApplication.Run
008482c5 +215 app.exe AppName 129 +42初始化

我从来没有能够去导致这种情况的底部,因为它发生很少很少我没有关心,但我想知道是什么原因,并希望纠正它...



编辑:完全堆栈跟踪



编辑2:更多信息...今天体验过的客户我的应用程序安装了大约4个月,每天8小时运行在他的电脑上。这个问题今天才出现,即使他杀了我的应用程序并重新启动也不断重现。他的系统上的其他应用程序都不奇怪。重新启动后,问题彻底消失。这是否指向史蒂夫提到的堆不足?



编辑3:有趣的msdn博客文章这里这里。虽然我不知道这是否是问题的原因,但它肯定是可能的。

解决方案

如果您的程序使用了很多的Windows资源可能是资源堆缺乏。



有一个注册表项可以增加,以提高XP的堆大小。对于Vista,Microsoft已经将默认值设置为较高。我建议将默认3072更改为至少8192。



此信息记录在 MS知识库(或搜索内存不足)。有关参数值的其他详细信息,请参见文章 KB184802



我建议你阅读知识库文章,但更改的基本信息是:


  1. 运行注册表编辑器(REGEDT32.EXE)。


  2. 从HKEY_ LOCAL_MACHINE子树中,转到以下项:

      \System\CurrentControlSet\Control\Session Manager\SubSystem 


  3. 在屏幕的右侧,双击该键:

      windows 


  4. 在弹出窗口中,您将看到一个非常长的字段。将光标移动到字符串开始处,寻找这个值(值可能会有所不同):

      SharedSection = 1024,3072,512 


  5. SharedSection使用以下格式指定系统和桌面堆: SharedSection = xxxx,yyyy,zzz 其中 xxxx 定义全系统堆的最大大小(以千字节为单位), yyyy 定义每个桌面堆的大小, zzz 定义非交互式窗口站的桌面堆大小。 p>


  6. 仅将 yyyy 值更改为8192(或更大),然后按OK。


  7. 退出注册表编辑器并重新启动PC,使更改生效。


祝你好运。


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.".

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...

EDIT: Full Stacktrace

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?

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.

解决方案

If your program uses a lot of windows resources it could be a Resource Heap shortage.

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.

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:

  1. Run Registry Editor (REGEDT32.EXE).

  2. From the HKEY_ LOCAL_MACHINE subtree, go to the following key:

    \System\CurrentControlSet\Control\Session Manager\SubSystem
    

  3. On the right hand side of the screen double-click on the key:

    windows 
    

  4. 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
    

  5. 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.

  6. Change ONLY the yyyy value to 8192 (or larger) and press OK.

  7. Exit the Registry Editor and reboot the PC for the change to take effect.

Good luck.

这篇关于系统错误。代码:8.没有足够的存储来处理这个命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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