ERROR_NO_SYSTEM_RESOURCES [英] ERROR_NO_SYSTEM_RESOURCES

查看:130
本文介绍了ERROR_NO_SYSTEM_RESOURCES的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个应用程序,它使用以下代码序列从Windows操作系统(W7)请求几部分内存:



< span style ="font-size:small">

rb = GetProcessWorkingSetSize(myProcessHandle,& min,& max);






< span style ="color:#0000ff; font-size:small"> 如果 (rb)
//成功GetProcessWorkingSetSize





{


temp =(fsize + 0x1000)/ 0x1000 ;


min = min +(temp * 0x1000)  + 0x12000;






如果 ((min + 0x10000)> max)



max = min + 0x10000;


rb = SetProcessWorkingSetSize(myProcessHandle,min,max);






如果 (rb)
// success





{


lHandle = CreateFileMapping(* mHandle ,&NBSP; pMySA,&NBSP; PAGE_READWRITE | SEC_NOCACHE | SEC_COMMIT,&NBSP; 0,FSIZE,姓名);


}








if (lHandle)
//成功OpenFileMapping或CreateFileMapping





{


PTR = MapViewOfFile(lHandle,FILE_MAP_WRITE,0,0,FSIZE);






if (ptr!= NULL)         
/ *请求内存的成功映射* /





{&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;     





/ *初始化内存和指针* /





rb = VirtualLock(ptr,fsize);






我们想要启动此应用程序的9个实例


当我们开始8实例,一切正常。


当我们启动第9个实例时,我们收到错误消息




<跨度郎= "EN-US">" ERROR_NO_SYSTEM_RESOURCES"


1450(0x5AA)


系统资源不足,无法完成所请求的服务。



调用"SetProcessWorkingSetSize"后。





是否有机会更改操作系统的配置,以便我们可以启动第9个实例?








$

解决方案

您好,


感谢您在此处发帖。


>>是否有机会更改操作系统的配置,以便我们可以启动第9个实例?


默认大小为50页面(例如,在4K页面大小的系统上这是204,800字节)。


也许您可以尝试以下步骤来更改默认的工作集大小。



1.单击"开始",单击"运行",键入regedit,然后单击"确定"。


2.Locate然后单击以下注册表子项:


<预类= "prettyprint"> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory管理

3.在编辑菜单上,指向新建,然后单击DWORD值。


4.在新值#1框中,键入PoolUsageMaximum ,然后按ENTER键。


5.右键单击PoolUsageMaximum,然后单击"修改"。


希望他可以帮到你。


最好的问候,


Baron Bi



We have a application, which request several portions of memory from the Windows OS (W7) with the following code sequence:

rb = GetProcessWorkingSetSize(myProcessHandle, &min, &max) ;

if( rb ) // success GetProcessWorkingSetSize


{

temp = (fsize + 0x1000) / 0x1000;

min = min + ( temp * 0x1000 )  + 0x12000 ;

if( (min + 0x10000) > max)

max = min + 0x10000;

rb = SetProcessWorkingSetSize(myProcessHandle, min, max);

if( rb ) // success


{

lHandle = CreateFileMapping(*mHandle,  pMySA, PAGE_READWRITE| SEC_NOCACHE | SEC_COMMIT,  0, fsize, name);

}

if( lHandle ) // success OpenFileMapping or CreateFileMapping


{

ptr = MapViewOfFile(lHandle, FILE_MAP_WRITE, 0, 0, fsize) ;

if( ptr != NULL )         /* successful map of requested memory */


{                          

/* initialize memory and pointer */


rb = VirtualLock(ptr, fsize);

We want to start up to 9 instances of this application

When we start 8 instances, everything works fine.

when we start the 9'th instance we receive the error message

"ERROR_NO_SYSTEM_RESOURCES"

1450 (0x5AA)

Insufficient system resources exist to complete the requested Service.

after calling "SetProcessWorkingSetSize".

Is there a Chance to Change the Configuration of the Operating System, so that we can start the 9'th instance?




解决方案

Hi,

thanks for posting here.

>>Is there a Chance to Change the Configuration of the Operating System, so that we can start the 9'th instance?

The default size is 50 pages (for example, this is 204,800 bytes on systems with a 4K page size).

Maybe you could try these steps below to change the default working set size.

1.Click Start, click Run, type regedit, and then click OK.

2.Locate and then click the following registry subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

3.On the Edit menu, point to New, and then click DWORD Value.

4.In the New Value #1 box, type PoolUsageMaximum, and then press ENTER.

5.Right-click PoolUsageMaximum, and then click Modify.

Hope this could be help of you.

Best Regards,

Baron Bi


这篇关于ERROR_NO_SYSTEM_RESOURCES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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