当前位置:网站首页>Why can't GC () free memory- Why does gc() not free memory?

Why can't GC () free memory- Why does gc() not free memory?

2022-06-25 06:25:00 Superior virtue and weak water

problem :

I run simulations on a Windows 64bit-computer with 64 GB RAM . I have 64 GB RAM Of Windows 64 Bit computer Run the simulation on .Memory use reaches 55% and after a finished simulation run I remove all objects in the working space by rm(list=ls()) , followed by a double gc() . Memory utilization rate reaches 55%, And after the simulation run , adopt rm(list=ls()) Delete all objects in the workspace , And then add double gc() .

I supposed that this would free enough memory for the next simulation run, but actually memory usage drops by just 1% . I thought this would free up enough memory for the next simulation run , But actually memory usage Just down 1% .Consulting a lot of different fora I could not find a satisfactory explanation, only vague comments such as: Consulted many different forums , I can't find a satisfactory explanation , Only vague comments , for example :

"Depending on your operating system, the freed up memory might not be returned to the operating system, but kept in the process space."“ It depends on your operating system , The freed memory may not be returned to the operating system , Instead, it remains in the process space .”

I'd like to find information on: I want to find information about :

  • 1) which OS and under which conditions freed memory is not returned to the OS, and1) Which operating system and under what conditions the memory released will not be returned to that operating system , as well as
  • 2) if there is any other remedy than closing R and start it again for the next simulation run?2) In addition to closing R And start again for the next simulation run , Are there any other remedies ?

Solution :

Reference resources : https://stackoom.com/en/question/zAz3
原网站

版权声明
本文为[Superior virtue and weak water]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202201234294608.html