" Win32Exception没有足够的存储是可用来处理此命令"作为Windows服务运行错误 [英] "Win32Exception Not enough storage is available to process this command" error when run as a windows service

查看:281
本文介绍了" Win32Exception没有足够的存储是可用来处理此命令"作为Windows服务运行错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时候,我得到的错误

Win32Exception没有足够的存储是可用来处理此命令

Win32Exception Not enough storage is available to process this command

在该应用程序已经运行了一个月左右左右。

after the application has been running for around a month or so.

这对应于<一href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396"相对=nofollow>系统错误

ERROR_NOT_ENOUGH_MEMORY (8)

通常情况下,它的运行为Windows服务,并改变它的身份登录仍然让错误发生的用户。不过,如果我在上面运行通过双击应用程序,它工作正常。它可以作为Windows服务重新运行的唯一方法是在服务器重新启动。

Usually, it's run as a Windows service, and changing the user it's logged on as still makes the error occur. However, if I run the application by double clicking on it, it works fine. The only way it can run as a Windows service again is if the server is restarted.

该错误会出现应用程序写入日志中。完整的错误是:

The error appears in the logs that the application writes to. The full error is:

System.ComponentModel.Win32Exception: Not enough storage is available to process this command
   at System.Windows.Forms.NativeWindow.WindowClass.RegisterClass()
   at System.Windows.Forms.NativeWindow.WindowClass.Create(String className, Int32 classStyle)
   at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
   at System.Windows.Forms.Control.CreateHandle()
   at System.Windows.Forms.Application.MarshalingControl..ctor()
   at System.Windows.Forms.Application.ThreadContext.get_MarshalingControl()
   at System.Windows.Forms.WindowsFormsSynchronizationContext..ctor()
   at System.Windows.Forms.WindowsFormsSynchronizationContext.InstallIfNeeded()
   at System.Windows.Forms.Control..ctor(Boolean autoInstallSyncContext)
   at System.Windows.Forms.ScrollableControl..ctor()
   at System.Windows.Forms.ContainerControl..ctor()
   at System.Windows.Forms.Form..ctor()
   at LicensingModule.LicenseKeyValidator..ctor(String Name, String Path)
   at MIDICOMExporter.Program.Main(String[] args)

我见过的其他答案说这涉及到服务器上的内存泄漏,但如果应用程序仍然可以运行双时点击,这是否意味着仍然可能存在内存泄漏?

I've seen other answers say it's related to a memory leak on the server, but if the application can still run when double clicked on, does that still mean there may be a memory leak?

此外,这是在Windows Server 2012上运行。

Also, this is running on Windows Server 2012.

推荐答案

是的,这个问题可能与服务器上的内存泄漏。也许桌面堆是耗尽。桌面堆非交互式Windows会话IST从桌面堆不同的真实(intercative)台式机。这就解释了,为什么双击应用还是可以的。

Yes, the problem might be related to a memory leak on the server. Maybe the desktop heap is depleted. The desktop heap for "non-interactive" windows session ist different from the desktop heap for real (intercative) desktops. This explains, why double clicking the application is still possible.

尝试找到注册表项\系统\ CurrentControlSet \控制\会话管理器\子系统和增加的SharedSection = XXX,YYY,ZZZ 的第三个参数(ZZZ)如在 MSKB 126962 (为YYY)。

Try finding the registry key \System\CurrentControlSet\Control\Session Manager\SubSystem and increasing the 3rd parameter (zzz) of SharedSection=xxx,yyy,zzz as described in MSKB 126962 (for yyy).

第三个SharedSection值(512)是桌面堆的大小   为与非交互式的窗口相关联的每个桌面   站。

The third SharedSection value (512) is the size of the desktop heap for each desktop that is associated with a "non-interactive" window station.

如果这解决您的问题,堆depletation,跑冒滴漏造成的资源例如,可能是你的问题的根源。 非交互式桌面堆的大小是由默认比标准堆小得多。

If this fixes your problem, heap depletation, caused for instance by leaking resources, is likely to be the source of your problem. The size of the "non-interactive" desktop heap is by default much smaller than the standard heap.

这篇关于&QUOT; Win32Exception没有足够的存储是可用来处理此命令&QUOT;作为Windows服务运行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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