简体   繁体   English

DOS / 4GW致命错误(1307):内存不足

[英]DOS/4GW Fatal Error (1307): not enough memory

I'm trying to run a dos/4gw application in Win7 32 bit OS. 我正在尝试在Win7 32位操作系统中运行dos / 4gw应用程序。 I'm getting the following error message, DOS/4GW fatal error (1307): not enough memory 我收到以下错误信息, DOS/4GW fatal error (1307): not enough memory

When I run the same application in WinXP 32 bit OS, it works fine and no issues. 当我在WinXP 32位操作系统中运行相同的应用程序时,它工作正常,没有问题。

The dos/4gw application was built using the Watcom C compiler. dos / 4gw应用程序是使用Watcom C编译器构建的。

The mem command shows the following avaiable memory, mem命令显示以下可用内存,

655360 bytes total conventional memory 655360 bytes available to MS-DOS 580640 largest executable program size 16777216 bytes total EMS memory 16777216 bytes free EMS memory 32505856 bytes total contiguous extended memory 0 bytes available contiguous extended memory 15580160 bytes available XMS memory MS-DOS resident in High Memory Area

From the above it is clear that the memory is less than 1MB. 从上面可以清楚地看出内存小于1MB。 However my program needs more than that. 但是我的计划需要更多。 Basically I need to extend my DOS memory to get more than 1MB of memory for running my dos/4gw application. 基本上我需要扩展我的DOS内存以获得超过1MB的内存来运行我的dos / 4gw应用程序。

Could any one please help in resolving this memory issue? 有人可以帮忙解决这个记忆问题吗?

Thanks! 谢谢!

-Anand -Anand

问题的答案是doynax发送的回复

"I believe there is a shim in recent versions of Windows limiting the available DPMI memory to 32 MB, for yet more ancient software incapable of unprepared such wast quantities of RAM. You may try creating a DpmiLimit key under HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\WOW in the registry to adjust this with the limit in bytes as a DWORD"

I wanted to help preserve why this setting exists, before it's lost to history. 我想帮助维护为什么这个设置存在,才失去了历史。

Short Version : Broken DOS extenders used 16-bit signed integers. 短版本 :破坏的DOS扩展器使用16位有符号整数。 Anything larger than 32,768 bytes (32 MB) will cause them to fail. 任何大于32,768字节(32 MB)的内容都会导致它们失败。


Thomas R. Nicely had a post in 2007 that points out the problem: Thomas R. Nicely在2007年发帖指出了这个问题:

Windows Vista restricts non-Win32 apps to 32 MB of memory ( archive ) Windows Vista将非Win32应用程序限制为32 MB内存 存档

And then there's a 2010 usenet post that reminds us that an operating system limiting the amount of memory available to DPMI: 然后有一个2010年的usenet帖子提醒我们一个操作系统限制了DPMI可用的内存量:


I recently came across Thomas R. Nicely's WWW page on Windows Vista's DPMI server. 我最近在Windows Vista的DPMI服务器上遇到了Thomas R. Nicely的WWW页面。 It's pretty confused. 这很困惑。 ( These people have some quite sensible things to say on the matter of M. Nicely's page.) And no wonder that it is, if this was how you explained things to M. Nicely, as xe claims you did. 这些人对M. Nicely的页面问题有一些非常明智的说法。)难怪它是,如果这是你向M.解释事情的方式,正如xe声称的那样。 (-: ( - :

This DPMI server limit is another case in point, as a matter of fact. 事实上,这个DPMI服务器限制是另一个例子。 M. Nicely presents this as some sort of mysterious conspiracy against gcc. M.很好地将此视为对gcc的某种神秘阴谋。 In actual fact, as pointed out by M. bwakaz, it's simple defence against all of the stupid and broken things that DPMI-based extended DOS applications are known to do, such as allocating all of the memory that is available at program startup, because they are badly written. 实际上,正如M. bwakaz指出的那样,它可以简单地防御基于DPMI的扩展DOS应用程序所做的所有愚蠢和破碎的事情,例如分配程序启动时可用的所有内存,因为他们写的很糟糕。 M. bwakaz points to an article by Raymond Chen that anyone wanting to understand this should read. M. bwakaz指出Raymond Chen的一篇文章 ,任何想要了解这一点的人都应该阅读。

This DpmiLimit setting that you mentioned is in fact nothing new. 你提到的这个DpmiLimit设置实际上并不新鲜。 It's simply undocumented on Windows NT 6. OS/2 VDM's have had a documented DPMI memory limit setting for almost two decades. 它只是在Windows NT 6上没有记录 .OS / 2 VDM已经记录了近二十年的DPMI内存限制设置。 The setting is DPMI_MEMORY_LIMIT . 设置为DPMI_MEMORY_LIMIT You can read on Usenet and the WWW hundreds of discussions of this, going back to about 1994, and the reasons for tweaking it up and down. 您可以阅读Usenet和WWW上的数百个讨论,可以追溯到1994年左右,以及上下调整它的原因。 On an OS/2 system one can open up a VDM settings notebook, and obtain on-line help describing the setting. 在OS / 2系统上,可以打开VDM设置笔记本,并获取描述设置的在线帮助。

Raymond Chen singles out DOS games as some of the particular offenders when it comes to abusing DPMI, and there's a whole FAQ for running DOS games under OS/2 that lists the various different DPMI_MEMORY_LIMIT (and other) settings for getting such games to play nicely with the operating system and not chew up memory unnecessarily, just because the DPMI server in the VDM would otherwuse allow them to. Raymond Chen在滥用DPMI时将DOS游戏列为一些特定的违规者,并且在OS / 2下运行DOS游戏的整个常见问题解答列出了各种不同的DPMI_MEMORY_LIMIT (以及其他)设置,以使这些游戏能够很好地发挥作用使用操作系统而不会不必要地咀嚼内存,只是因为VDM中的DPMI服务器可以让其他人使用。

Again, NTVDM isn't being "weird", at all. 同样,NTVDM根本不是“怪异”。 It's implementing a setting, and a limit, that is par for the course in Virtual DOS Machines. 它正在实现一个设置和限制,它与虚拟DOS机器中的课程相同。 Even the default of 32MiB isn't unusual. 即使是默认的32MiB也不例外。 The default for DPMI_MEMORY_LIMIT in OS/2 VDMs was (in recent versions of OS/2, if memory serves) 64MiB. OS / 2 DPMI_MEMORY_LIMITDPMI_MEMORY_LIMIT的默认值是(在OS / 2的最新版本中,如果内存可用)64MiB。 If you read Raymond Chen's article all of the way to the end, there's even an explanation of why such values are the defaults: It's to cope with the broken extended DOS programs that measure available DPMI memory in KiB using 16-bit integers. 如果您一直读到Raymond Chen的文章,那么甚至可以解释为什么这些值是默认值:它是为了应对破坏的扩展DOS程序 ,它使用16位整数来测量KiB中的可用DPMI内存。 (NTVDM's default assumes signed 16-bit integers. OS/2's VDM default assumes unsigned 16-bit integers.) (NTVDM默认采用带符号的16位整数.OS / 2的VDM默认采用无符号16位整数。)

All of these things — be they traps into the VM monitor from inside the VDM, or DPMI server limits to control badly written DOS programs — aren't NTVDM being "weird" or unusual, or secret conspiracies by Microsoft against people who think that compiling with gcc means that one is compiling extended DOS programs. 所有这些 - 无论是从VDM内部陷入VM监视器,还是DPMI服务器限制来控制编写严重的DOS程序 - 不是NTVDM是“怪异”或不寻常的,或微软对那些认为编译的人的秘密阴谋使用gcc意味着一个正在编译扩展的DOS程序。 They're simple long-standing practice for VDMs, and run-of-the-mill stuff for virtual machine technology that goes back for decades. 它们是VDM的简单长期实践,也是可以追溯到几十年的虚拟机技术的普通工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM