R & Shiny not releasing memory after session ends in Shiny

,

Hi

I have been having memory issues with R shiny on windows in which the size of the process for R grows as the number of sessions increase ( we expect this)

However when the sessions close - the size of the R process does not decrease. Please could someone explain to me if this is the intended behavior or if this is a bug?

I have tried implementing the garbage collector function from base R to manually do garbage collection but that has not returned anything useful. The size of the process continues to grow

If a session in R shiny ends via a browser disconnect then I would hope that R would free the memory which the session is no longer using.

Are you sure the memory is actually being occupied, and not just reported as used? In any case, you could take a look at the {lobstr} package (Function reference • lobstr), namely mem_used(), to try diagnosing further.

Please see this related GitHub issue.