dotnet / dotnet/fsharp

FS0193: error : Exception of type 'System.OutOfMemoryException' was thrown during compile

Open
#10,581 6 comments 0 reactions 0 assignees View on GitHub
Area-Compiler Feature Improvement
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity2.visualstudio.com/t/FS0193:-error-:-Exception-of-type-Syste/1195449)._

---
[severity:I'm unable to use this version of Visual Studio]
out of memory error building an F# project with 1031 modules and 15619 exported functions with at least 30000 functors within the public exported function.
The code is part of a open-source project https://github.com/channell/Cephei (with upto-date commit) built using VS2019 16.7.4.
devenv.exe peaks at 4gb of memory, and fsc.exe hits 2gb of memory. The issue appears to be the size of the intermediate ILX produced by the F# compiler before reducing to IL for code generation because compilation time became ever slower as more compile errors (I've generated the code from a tool). I've replicated the failure with msbuild (and have dump file), but could not compile with 64-bit msbuild because of tool references.

I believe this would be resolved by running fsc.exe with 64-bit msbuild, but I'm not convinced all the referenced files are AnyCPU

---
### Original Comments

#### Feedback Bot on 9/23/2020, 08:10 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

---
### Original Solutions
(no solutions)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.