Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# Interactive Memory Leak

If I open up fsi and paste the following:

[1..10000000];;
[1..10000000];;
[1..10000000];;
[1..10000000];;
[1..10000000];;
[1..10000000];;
[1..10000000];;
[1..10000000];;
[1..10000000];;

I get:

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Same thing if I prefix with let x =. It seems that top level references continue to be held, no matter how inaccessible they may be. Is there any way to clean these things up, without losing the convenience of being able to step through your data? Right now I'm simply restarting to clean up, but it's inconvenient.

like image 616
Lamarth Avatar asked Oct 27 '25 05:10

Lamarth


1 Answers

I don't think that there is a way to clean top level references in FSI. You can increase amount of memory that FSI can address using 64-but mode for F# Interactive process. In VisualStudio it is "Tools-Options-F# Tools->F# Interactive" settings

like image 141
Petr Avatar answered Oct 29 '25 08:10

Petr