WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Arrays
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

ArrayFileGet VMalloc Error

 Keywords:  ArrayFileGet ArrayFileGetCsv FileRead VMalloc Error VirtualAlloc Failed IntControl 65

Question:

Script is choking on the ArrayFileGet. Error reported is "VMalloc error - VirtualAlloc failed", and that box has the number 487 on it. I'm running XP with 4 GB RAM, using Winbatch 2005C. (Older version but good one.)

File size: 199,252,976 bytes (200MB). Admittedly large. 2,735,193 lines in it. All the lines are < 300 bytes.

Script that now bombs was executing fine, until just recently. The data file has gradually grown.

Is there a known limit for parsing a file into strings using ArrayFileGet? If so, does a newer version of Winbatch not have whatever wall I'm hitting?

Answer:

You are running out of string memory. You should be using a database like sqlite or partitioning the file into smaller, more manageable, chunks with the binary file functions. I wont go into a protracted explanation of process memory limits and string allocation but files of that size are beyond the scope of 'ArrayFileGet'. We can't tell you exactly what the maximum file size is for the function because there are too many variables and the limit changes based on those variables.

In short it isn't the number of lines/strings that is causing your script to run out of string memory. It is the combined size (sum of the lengths times the size of a character) of all the strings that is causing your script to run out of string memory.

The error you are receiving only occurs when reserved memory for strings is exhausted.


Article ID:   W17654
Filename:   ArrayFileGet VMalloc Error.txt
File Created: 2013:03:01:09:17:48
Last Updated: 2013:03:01:09:17:48