first chance exception: system error 8: not enough storage space to perform the command

﹥>﹥吖頭↗ 提交于 2019-12-25 13:01:15

问题


how do i debug something like this? i need the debugger to stop and show me where the problem is. don't just show it in the event log & then hang.

first chance exception: system error 8: not enough storage space to perform the command

i'm using delphi 2009. the problem doesn't happen regulary. i'm not eager to pepper my program with OutputDebugString calls to track this down!

thank you for your help!


回答1:


You are looking at a resource leak on your server, more than likely... Either handle related, or memory related...

I've had this happen a lot, and it's always the case... There CAN be other causes, but I think a resource leak is your #1 cause...

You are going to have to either find it and fix it, or start putting debug checks in on all memory allocations, handle allocations, and log them anytime you can't get memory, or handles.

It's also possible that your CLIENT machine is out of resources, but usually, it's the server at fault...

Failing all that, give us some more idea of what you are doing, what the code looks like, etc, to help spot issues. Just based on the error alone, isn't a lot to go on...




回答2:


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 Knowledge Base Article ID 126962 (or search for "Out of Memory"). Additional details concerning the parameter values may be found in the Knowledge Base Article ID 184802.

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 folder:

   \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 "noninteractive" 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



来源:https://stackoverflow.com/questions/736456/first-chance-exception-system-error-8-not-enough-storage-space-to-perform-the

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!