Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Merge fsharp-editor to net6 #20

Merged
merged 4 commits into from
Nov 12, 2021
Merged

Merge fsharp-editor to net6 #20

merged 4 commits into from
Nov 12, 2021

Conversation

kdubau
Copy link
Member

@kdubau kdubau commented Nov 11, 2021

No description provided.

nosami and others added 4 commits October 22, 2021 14:02
FCS contains the following method

```fs
    member _.CheckMaxMemoryReached() =
        if not maxMemoryReached && GC.GetTotalMemory(false) > int64 maxMB * 1024L * 1024L then
            Trace.TraceWarning("!!!!!!!! MAX MEMORY REACHED, DOWNSIZING F# COMPILER CACHES !!!!!!!!!!!!!!!")
            // If the maxMB limit is reached, drastic action is taken
            //   - reduce strong cache sizes to a minimum
            maxMemoryReached <- true
            braceMatchCache.Resize(AnyCallerThread, newKeepStrongly=10)
            backgroundCompiler.DownsizeCaches()
            maxMemEvent.Trigger( () )

```

On the surface, this looks fine, but on Mono GC.GetTotalMemory can be
slow and it is called repeatedly.

Set maxMemoryReached via reflection to short circuit this code (which always
returns false anyway due to high maxMB setting)
@nosami nosami merged commit c99fee4 into net6 Nov 12, 2021
@nosami nosami deleted the fsharp-editor branch November 12, 2021 10:03
nosami added a commit that referenced this pull request Jan 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants