Results 1 to 36 of 36

Thread: Is there a 2 GB run-time size limit on a VB6 application?

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2012
    Posts
    24

    Is there a 2 GB run-time size limit on a VB6 application?

    I'm trying to declare an array in a vb6 application that is a little larger than 2GB in size; it gets an "out of memory" error at run time. I distilled the application down to a single Dim (removing all code), as shown below:
    Code:
    ' "comment out" one of these two:
    '   Private A(1 To &H65F00000) As Byte ' works with this active
        Private A(1 To &H66000000) As Byte ' fails with this active
    The app runs when the first line is used, and fails at run time (NOT at compile time) with an "out of memory" message when the second line is used.

    It looks like there is some kind of 2GB limit on the size of an application at run time.
    It doesn't help if I divide the array in half and put the two arrays in separate modules.
    It doesn't help if I assign the arrays dynamically at run time.

    I looked here for some specification from Microsoft, but saw nothing pertinent.

    Am I correct that there is a 2GB limit on application size? Where is it specified?

    What is the easiest workaround?
    • Use a system call to allocate memory and address it manually (would this be exempt from the 2GB limit?)
    • Call two separate custom DLLs, each containing half of the array
    • Some other technique I haven't thought of
    Last edited by jfhoff; Sep 30th, 2013 at 10:04 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width