I've already checked this post How to clear up RAM without exiting kernel?
But the longer my code works, it builds up RAM and cannot clear it. I've stopped the evaluation and done the following.
- Clear all my variables
- Unprotect Out and clear it
- Clear cache
- set $HistoryLength=0
I did run the SystemInformation["Machine"] check and obtained
{MemoryAvailable->2.81581GiB,PhysicalUsed->13.3471GiB,PhysicalFree->89.7188MiB,PhysicalTotal->16.GiB,VirtualUsed->15.9964GiB,VirtualFree->19.GiB,VirtualTotal->19.GiB,PageSize->16.KiB,PageUsed->2.64923GiB,PageFree->359.188MiB,PageTotal->3.GiB,AppMemory->3.4355GiB,Wired->1.57626GiB,Active->2.76234GiB,Inactive->2.7282GiB,Compressed->8.33537GiB,PageIns->4468192,PageOuts->49208}
Seems like Mathematica maintains a lot of RAM used as Compressed and I cannot find a way to clear it from code. Obviously, if I free the kernel the memory goes back down, but I wish to have my code running for days without reaching that much RAM usage
I am using Version 13.3.1 for Mac OS X ARM (64-bit) (July 24, 2023)
{
{" Machine Type", "ARM"},
{" Operating System", "MacOSX"},
{" Processor Type", "ARM64"}
}
Thank you in advance
MemoryInUse[]
to locate the problem ... $\endgroup$