Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vsfeedback opened this issue Dec 2, 2020 · 6 comments

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[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)

@cartermp
Copy link
Contributor

cartermp commented Dec 2, 2020

The number of things getting compiled into a single assembly is enormous, so I don't know what all we could do.

@cartermp cartermp added this to the Backlog milestone Feb 6, 2021
@KevinRansom
Copy link
Member

64 bit dev 17 has been announced. Consumed memory may be less of an issue.

@channell
Copy link

64-bit Visual Studio 2022 may have been announced but preview 2.1 still includes a x86 fsc.exe.
The issue is with memory usage during compilation, and has not been resolved

@vzarytovskii
Copy link
Member

vzarytovskii commented Aug 11, 2021

Gonna reopen this one, since it's still an issue.

@TIHan fyi, you may have been looking into this one before?

We may want to use mmf when deal with ilx.

@dsyme
Copy link
Contributor

dsyme commented Aug 11, 2021

64-bit Visual Studio 2022 may have been announced but preview 2.1 still includes a x86 fsc.exe.

I didn't realise fsc.exe was still 32-bit.

Can we put include an fsc64.exe and use that by default?

@channell
Copy link

channell commented Aug 11, 2021

This is important for one of the global Banks that depend on F# for quantitative finance, that has also experienced this "issue". It's an issue rather than a fault because all functional languages use more (compilation) memory for type inference.
It is an issue for F# because [1] it does more type inference than other languages [2] large F# projects run to millions of lines of code (even though they are a fraction of the size of a comparable imperative libraries).

This was referenced Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: New
Development

No branches or pull requests

6 participants