Release RAM again after closing the file?
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
- thomas-neemann
- Veteran
- Posts: 11958
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Release RAM again after closing the file?
does it take a lot of programming to free up RAM after closing the file?
here is an example
with the file open
after closing the file
after restart
here is an example
with the file open
after closing the file
after restart
Re: Release RAM again after closing the file?
Your analysis basically makes no sense.
RAM is not only (only few) taken by documents, but also by workbenches and libraries loading. These latter ones aren't freed on document close (which is totally correct).
RAM is not only (only few) taken by documents, but also by workbenches and libraries loading. These latter ones aren't freed on document close (which is totally correct).
- thomas-neemann
- Veteran
- Posts: 11958
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: Release RAM again after closing the file?
I started freecad for this test and then immediately loaded the (large) file without loading a workbech
Re: Release RAM again after closing the file?
Depending on object types inside the document, tons of libs can be loaded just to compute it at opening time.thomas-neemann wrote: ↑Thu Dec 09, 2021 11:13 am I started freecad for this test and then immediately loaded the (large) file without loading a workbech
- thomas-neemann
- Veteran
- Posts: 11958
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: Release RAM again after closing the file?
then you could recommend restarting freecad after closing a file before opening a new one?
Re: Release RAM again after closing the file?
Nope. It doesn't change anything roughly.thomas-neemann wrote: ↑Thu Dec 09, 2021 11:52 am then you could recommend restarting freecad after closing a file before opening a new one?
If you want to have an idea, do a copy of your sample doc. From a fresh FC start, open the original one, look at the RAM consumption, then open the copy, and look at the extra RAM amount. This is roughly how much is "consumed" by the doc. Close the copy and look if RAM is freed.
- thomas-neemann
- Veteran
- Posts: 11958
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: Release RAM again after closing the file?
I've done that now. according to my measurements on a linux system i used 2.3 gb ram when opening the copy. after closing the copy, only 0.006 gb was released. so the question remains whether you can reprogram it with low of effort, or restart freecad after closing large files?
edit
OS: Ubuntu 20.04.1 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.26554 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 817c14b)
Hash: 817c14b16af681b06aec7d8c79f744c7a88fa3c3
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: German/Germany (de_DE)
Re: Release RAM again after closing the file?
Could you give all numbers please (sorry to insist, but need a good understanding) :
* RAM occupied just after FC start
* RAM occupied just after opening the sample doc
* RAM occupied just after opening the copy of the doc
* RAM occupied just after closing the copy of the doc
Will do some tests on my side.
Notice that it is hard to diagnose an actual "problem". For example, the OS when you open a file can copy it into RAM, then when you close it choose to keep it in RAM in case you'll need it again soon. It doesn't need that the RAM isn't freed by the program, just the OS has a good RAM strategy.
- thomas-neemann
- Veteran
- Posts: 11958
- Joined: Wed Jan 22, 2020 6:03 pm
- Location: Osnabrück DE 🇩🇪
- Contact:
Re: Release RAM again after closing the file?
OK, I tried to open/close 20-30 times the same document, and RAM values are almost steady, so at least there doesn't seem to be a significant leak.
After 200 repeated open/close, it's 4 MB increase in RAM, so looks acceptable to me.