VB6内存限制 [英] VB6 Memory Limitations
问题描述
我目前正在支持在多个服务器上运行的VB6应用程序(我们正在替换它,但这是一个缓慢的过程!).谁能告诉我VB6进程可以寻址的最大内存量是多少?我们正在使用各种操作系统:
I'm currently supporting a VB6 application (that we are replacing, but it's a slow process!) that is running on several servers. Can anyone tell me please what the maximum amount of memory of VB6 process can address is? We are using a variety of operating systems:
- Windows Server 2003 32位
- Windows Server 2008 64位
- Windows Server 2008 R2 64位
I've tried using resources like this: https://blogs.msdn.microsoft.com/tom/2008/04/10/chat-question-memory-limits-for-32-bit-and-64-bit-processes/
但是我怀疑这是否准确,因为它讨论了基于.NET的应用程序,但是我找不到比这更重要的东西了.
But I'm skeptical if this is accurate due to it discussing .NET based applications, however I can't find anything more on point than this.
推荐答案
很难认真对待这些如果超人与上帝交战怎么办"的问题.很久以前,您应该已经从驻留内存的数据结构转移到了磁盘文件或数据库.
It is hard to take these "What if Superman got in a fight with God" questions too seriously. Long before this becomes a concern you should have moved from memory-resident data structures to a disk file or a database anyway.
但是,即使不与/LARGEADDRESSAWARE链接并引导到3GB模式,VB6程序也可以在32位Windows上处理相当多的数据.
But even without linking with /LARGEADDRESSAWARE and booting into 3GB mode a VB6 program can address quite a bit of data on 32-bit Windows.
Option Explicit
Private Sub Main()
Const MAX_BYTES As Long = &H63700000
Dim Bytes() As Byte
ReDim Bytes(MAX_BYTES)
Bytes(MAX_BYTES) = 255
MsgBox "Success" & vbNewLine & vbNewLine _
& "Bytes(MAX_BYTES) = " & CStr(Bytes(MAX_BYTES)) & vbNewLine & vbNewLine _
& "MAX_BYTES = " & Format$(MAX_BYTES, "#,##0")
End Sub
结果:
Success
Bytes(MAX_BYTES) = 255
MAX_BYTES = 1,668,284,416
链接的博客文章正确指出了.Net流程的局限性以及它们无法应对使用大量数据的问题.像.Net这样的脚本引擎并不是为这些目的而构建的,即使最简单的.Net程序拖到其地址空间中,也不要低估巨大的库的开销.
The linked blog post is correct in pointing out the limitations of a .Net process and their inability to cope with using large amounts of data. Scripting engines like .Net just are not built for these things, and don't underestimate the overhead of the gigantic libraries even the simplest .Net program drags into its address space.
这篇关于VB6内存限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!