title: How to fix Run Time Error '7' Out of memory in visual basic 6?
body: <p>I am trying to ZIP a folder with sub folders and files in vb6. For that I read each file and store them one by one in byte array using Redim Preserve. But large folders having size larger than 130MB throw an Out of Memory error.I have 8 GB of RAM in my PC so it shouldn't be a problem.So, is this some limitation by visual basic 6 that we can't use more than 150MB memory? </p>
  
  <pre><code>'Length of a particular File is determined
  lngFileLen = FileLen(a_strFilePath)
  
  DoEvents
  If lngFileLen &lt;&gt; 0 Then
      m_lngPtr = m_lngPtr + lngFileLen
  
      'Next line Throws error once m_lngPtr reaches around 150 MB
      ReDim Preserve arrFileBuffer(1 To m_lngPtr)
  </code></pre>