Error 2, LabVIEW: Memory is Full when Building a LabVIEW Executable
Primary Software: LabVIEW Toolkits>>Application Builder
Primary Software Version: 8.2.1
Primary Software Fixed Version: N/A
Secondary Software: N/A
Problem: I have a very large LabVIEW 8.20 or 8.2.1 application that I need to build into an executable application. When I attempt to build the application, the build fails with
Error 2, LabVIEW: Memory is Full. I have plenty of available RAM, and I can build smaller applications without a problem. Furthermore, I am able to build this same application in LabVIEW 8.0 or 8.0.1.
Solution: The LabVIEW Application Builder reports
Error 2, LabVIEW: Memory is Full because it cannot find a contiguous memory space large enough to build a resource file before it moves the file into the executable. This is not a bug in LabVIEW, but a limitation in the memory space available to a single process on a 32-bit operating system.
You can work around this issue by building a smaller executable. Build a smaller executable by bundling dependent subVI's and dynamic VIs into an external support LLB and distributing it with the built application.
- Add all dynamic and 1st level subVIs to the project. Use the attached VI, "add subVIs to project.vi", to add all 1st level static subVIs to the project, but you must add dynamic VIs manually.
- Organize the newly added VIs in the project into a 1st Level subVIs folder and a Dynamic VIs folder. The project should be organized similar to the project in Figure 1. If you use the "add subVIs to project.vi" utility, then you may need to remove custom controls and type defs that may be automatically added to the project.
Figure 1: Project Structure
- After you add all 1st level subVIs and dynamic VIs to the project, create or edit your application build specification.
- On the Source Files page of the Application Builder, move your top-level VI into the Startup VIs section and move the 1st Level subVIs and Dynamic VIs folders into the Dynamic and Support Files section.
- On the Desinations page, create a new destination called supportfiles. Make the supportfiles destination an LLB by checking the Destination is LLB box.
- In the Source File Settings page, select the 1st level subVIs and dynamic VIs folders and then place a check mark in Set destination for all contained items. Under Set destination for all contained items, select supportfiles.

Figure 2: Source File Settings
- Make any further changes you need to the application properties, such as creating a custom application name, icon, or version number. The key settings for working around Error 2 have already been made.
- Close the build specification.
- Save the project.
- Compile the application build specification.
- The application should now compile successfully.
This alternative method for building an executable will result in an executable much smaller than traditional methods. This is accomplished by moving all the executable dependencies into an external support LLB. Because the Application builder is not forced to place all the subVI's and dynamic VIs into the executable, LabVIEW should not run out of memory.
The Application Builder will automatically update all static VI paths from the executable to the subVI dependencies in the support LLB. You must exercise extra care to ensure that dynamic VIs are still referenced correctly because they will no longer be contained within the executable. Use relative paths to point any dynamic VI calls from the top-level VI to their new location in "supportfiles.llb".
LabVIEW 8.5 Update: LabVIEW's internal process for moving dynamic and subVIs into an executable has changed in LabVIEW 8.5, avoiding this issue.
Related Links:
Attachments:
add subVIs to project.vi
Report Date: 08/23/2007
Last Updated: 09/01/2007
Document ID: 4CMMSHB7