Page 1 of 1

How to flush or unload RAM?

Posted: Tue Jan 02, 2024 8:38 am
by sonny

    Fresh booting

    memory-then.png
    memory-then.png (21.82 KiB) Viewed 1075 times

      After hours / days / weeks of working

      memory-now.png
      memory-now.png (22.31 KiB) Viewed 1075 times

      Any idea how to flush or unload the 6.848GB from RAM (7.55GB - 702MB)
      without saving or rebooting in PM13 (like "Eternal Sunshine of the Spotless Mind")?
      Tried BleachBit to no avail.

      In Windows 10, some simply do this:

      windows.png
      windows.png (28.61 KiB) Viewed 1075 times

      Re: Flush or Unload Memory?

      Posted: Tue Jan 02, 2024 8:46 am
      by Jasper

      @sonny

      You could try this script and see if it helps you.

      https://www.mediafire.com/file/twnzyg49 ... m.zip/file

      Just extract the zipped file and then right click, run in terminal.


      Re: Flush or Unload Memory?

      Posted: Tue Jan 02, 2024 8:48 am
      by sonny
      Jasper wrote: Tue Jan 02, 2024 8:46 am

      @sonny

      You could try this script and see if it helps you.

      https://www.mediafire.com/file/twnzyg49 ... m.zip/file

      Just extract the zipped file and then right click, run in terminal.

      I did but it was ineffective and insignificant.


      Re: Flush or Unload Memory?

      Posted: Tue Jan 02, 2024 4:42 pm
      by mikeslr

      Maybe CleanRAM by Argolance, viewtopic.php?p=25645&sid=c5bc3b898e3a2 ... d4c#p25645

      But how are your running your Puppy? With 7.55 Gb in RAM, it appears that you are not using a SaveFile/Folder, nor any SFSes nor AppImages --each of which are mounted rather than loaded into RAM-- nor portables which are linked to your OS. All of the foregoing just create links to their file-systems, copying components into RAM as needed and unloaded when no longer in use.

      My best guess is that you've stuffed everything into 'alphabet drives' --e.g., adrv.sfs, ydrv.sfs-- which are copied entirely into RAM on bootup; or have Remastered so that your puppy_version.sfs includes everything and are not using the 'nocopy' argument in your boot-stanza.


      Re: Flush or Unload Memory?

      Posted: Tue Jan 02, 2024 5:00 pm
      by sonny
      mikeslr wrote: Tue Jan 02, 2024 4:42 pm

      Maybe CleanRAM by Argolance, viewtopic.php?p=25645&sid=c5bc3b898e3a2 ... d4c#p25645

      But how are your running your Puppy? With 7.55 Gb in RAM, it appears that you are not using a SaveFile/Folder, nor any SFSes nor AppImages --each of which are mounted rather than loaded into RAM-- nor portables which are linked to your OS. All of the foregoing just create links to their file-systems, copying components into RAM as needed and unloaded when no longer in use.

      My best guess is that you've stuffed everything into 'alphabet drives' --e.g., adrv.sfs, ydrv.sfs-- which are copied entirely into RAM on bootup; or have Remastered so that your puppy_version.sfs includes everything and are not using the 'nocopy' argument in your boot-stanza.

      Thank you, Sir Mike.
      I did and it was insignificant.
      No, I use 'nocopy' all the way since it's more relevant today (USB, SSD, & other flash media are running so much faster these days).

      Note: This case is for the default stock Fossapup64 for 'non-nocopy' and PM13, not DARKPUPPY & DARKPUPPY BE ('nocopy' by default).


      Re: Flush or Unload Memory?

      Posted: Tue Jan 02, 2024 5:07 pm
      by Marv

      The fact that memory use grows with time to me points the finger at cache. Browsers are a big, but not the only offender here. Without knowing details on your install and browsers I can't point to specific locations but a file search for cache (and/or ".cache" should find the locations. Have a look at what is in them. Basically all cache contents can be safely deleted and it is pretty simple to write a script to do that and execute it manually or crond it. I have all my browsers set to clear cache on shutdown and that pretty much takes care of it for me.

      It could be a memory leak but it's simple to check and deal with the cache bloat first.


      Re: Flush or Unload Memory?

      Posted: Tue Jan 02, 2024 6:05 pm
      by sonny
      Marv wrote: Tue Jan 02, 2024 5:07 pm

      The fact that memory use grows with time to me points the finger at cache. Browsers are a big, but not the only offender here. Without knowing details on your install and browsers I can't point to specific locations but a file search for cache (and/or ".cache" should find the locations. Have a look at what is in them. Basically all cache contents can be safely deleted and it is pretty simple to write a script to do that and execute it manually or crond it. I have all my browsers set to clear cache on shutdown and that pretty much takes care of it for me.

      It could be a memory leak but it's simple to check and deal with the cache bloat first.

      Even with zero browsing, processes like copying and pasting (large) files, compiling, making pets and sfses, and stuff will quickly fill the RAM.


      Re: How to flush or unload RAM?

      Posted: Tue Jan 02, 2024 10:21 pm
      by mikeslr

      The graphic in your OP seems to be conky --guessing as I don't use it.

      I wonder if there's a bug, or somehow the code it uses to calculate RAM usage has been broken?

      What do Menu>System>Htop System Process Viewer, or Menu>System>Pupsys-Info, click Devices>Memory tell you?


      Re: How to flush or unload RAM?

      Posted: Tue Jan 02, 2024 11:13 pm
      by sonny
      mikeslr wrote: Tue Jan 02, 2024 10:21 pm

      The graphic in your OP seems to be conky --guessing as I don't use it.

      I wonder if there's a bug, or somehow the code it uses to calculate RAM usage has been broken?

      What do Menu>System>Htop System Process Viewer, or Menu>System>Pupsys-Info, click Devices>Memory tell you?

      Is this Conky's 'broken' RAM usage calculation that you mentioned?

      PSI-vs-Conky.jpg
      PSI-vs-Conky.jpg (78.07 KiB) Viewed 923 times

      Re: How to flush or unload RAM?

      Posted: Wed Jan 03, 2024 12:38 am
      by some1
      sonny wrote: Tue Jan 02, 2024 6:05 pm

      Even with zero browsing, processes like copying and pasting (large) files, compiling, making pets and sfses, and stuff will quickly fill the RAM

      Stuff are kept in RAM/cached for potential fast reuse/
      re-access .
      The system manages cache-swapping.
      The system manages storage-IO.

      Why do you want to clear the RAM/caches?


      Re: How to flush or unload RAM?

      Posted: Wed Jan 03, 2024 1:12 am
      by sonny
      some1 wrote: Wed Jan 03, 2024 12:38 am
      sonny wrote: Tue Jan 02, 2024 6:05 pm

      Even with zero browsing, processes like copying and pasting (large) files, compiling, making pets and sfses, and stuff will quickly fill the RAM

      Stuff are kept in RAM/cached for potential fast reuse/
      re-access .
      The system manages cache-swapping.
      The system manages storage-IO.

      Why do you want to clear the RAM/caches?

      1. 'In case' I need to use it for RAM-intensive apps
      2. Because seeing the longer memory bar is terrifying?
        :shock:

      Re: How to flush or unload RAM?

      Posted: Wed Jan 03, 2024 1:16 am
      by mikewalsh

      @mikeslr :-

      I understand your reasoning vis-a-vis that 7.5 GB in RAM, and I see where you're coming from.

      However, I quite frequently have anywhere between 6-12 GB RAM in use during a session.....composed of perhaps 4-5 browsers all open at the same time, and maybe half-a-dozen or so other apps multi-tasking in the background. It's not hard to do, though with 32GB of the stuff, an almost 4GHz 9th-gen quad-core Pentium 'Gold' and over 5TB+ of fast drive storage, the system barely notices it.

      I don't use "alphabet" drvs. Just a bog-standard save-folder.....

      (shrug...)

      Mike. ;)


      Re: How to flush or unload RAM?

      Posted: Wed Jan 03, 2024 2:20 pm
      by mikeslr

      Sonny, the difference between the amount of RAM used as reported by Pupsys-Info and Conky in the graphics of your last post could just be how those applications are doing the calculations; in particular, how it calculates the effect of cached files.

      But I assume your screen-shots were taken after a reboot. If that's the case, the only way to tell if cache is being cleared is to run your computer 'normally' for a while, then use one of the cache cleaning techniques/applications and compare the results again, I know that on my systems CleanRAM does clear cache. But not entirely: remember on boot-up the compressed 'alphabet drives' and compressed Puppy's core SFS --unless the 'nocopy' option is used-- are copied into RAM cache. After running CleanRAM, its computations will still reflect their presence.


      Re: How to flush or unload RAM?

      Posted: Wed Jan 03, 2024 7:56 pm
      by sonny
      mikeslr wrote: Wed Jan 03, 2024 2:20 pm

      Sonny, the difference between the amount of RAM used as reported by Pupsys-Info and Conky in the graphics of your last post could just be how those applications are doing the calculations; in particular, how it calculates the effect of cached files.

      But I assume your screen-shots were taken after a reboot. If that's the case, the only way to tell if cache is being cleared is to run your computer 'normally' for a while, then use one of the cache cleaning techniques/applications and compare the results again, I know that on my systems CleanRAM does clear cache. But not entirely: remember on boot-up the compressed 'alphabet drives' and compressed Puppy's core SFS --unless the 'nocopy' option is used-- are copied into RAM cache. After running CleanRAM, its computations will still reflect their presence.

      Sir Mike, thank you for your reply.
      I guess 'nocopy' is more relevant today (RAM speed vs. SSD speed in real operation).
      And last time I checked, a 20-year-old PC with HDD and a 10-year-old PC
      with smaller SSD had comparable prices.