Author Topic: Memory not being returned to system?  (Read 888 times)

humdinger70

  • Guest
Memory not being returned to system?
« on: April 20, 2010, 12:26:41 PM »
I've noticed that memory is still being held by the system, even with no apps running.  ??? ???

This is PCLinuxOS 2010 KDE running in VirtualBox 3.1.6 on a Mac OS X 10.6.3 host.

I did a boot recently, did a 'free' - saw about 480Meg (out of 1500 Meg allocated to the VM) in use and no swap space in use. I've run a few apps (FireFox, Synaptic, a few games) where I do my usual thing (open it, do my work in the app, close it). I also minimize the VirtualBox window when I'm not using it (and need to run my Mac apps).

After doing some of the above stuff for awhile, I did another 'free' - and noticed about 1400Meg in use and about 470Meg of swap space (out of 3000Meg allocated for swap). No apps are running, so that memory usage looks awfully high.

Is this normal behavior? I'm concerned that resources aren't being released as they should.

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6246
Re: Memory not being returned to system?
« Reply #1 on: April 20, 2010, 12:33:59 PM »
 how much memory did you tell virtualbox to use for pclinuxos? Since pclinuxos is running inside a virtual machine, memory issues you may have are primarily btw virtualbox and your mac system.

Do you have any other virtualized system? does your host system use the same amount of memory when guest systems are given the same about of memory?
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

humdinger70

  • Guest
Re: Memory not being returned to system?
« Reply #2 on: April 20, 2010, 01:34:24 PM »
how much memory did you tell virtualbox to use for pclinuxos? Since pclinuxos is running inside a virtual machine, memory issues you may have are primarily btw virtualbox and your mac system.

Do you have any other virtualized system? does your host system use the same amount of memory when guest systems are given the same about of memory?
My host machine has 4Gig RAM, I've given the VBox guest 1.5 Gig. It's the only VM on my system.

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6246
Re: Memory not being returned to system?
« Reply #3 on: April 20, 2010, 02:05:26 PM »

The guest will have 1.5 GB if you gave it that much and linux will use as much memory as it can to cache data it thinks it might need at some point in the future and this is why you may see the memory as being used while no application is running. The memory is caches and its not that expensive for the system to get rid of it when in need of memory. It is essentially a non issue of the linux side.   

.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

humdinger70

  • Guest
Re: Memory not being returned to system?
« Reply #4 on: April 20, 2010, 09:43:12 PM »

The guest will have 1.5 GB if you gave it that much and linux will use as much memory as it can to cache data it thinks it might need at some point in the future and this is why you may see the memory as being used while no application is running. The memory is caches and its not that expensive for the system to get rid of it when in need of memory. It is essentially a non issue of the linux side.   


In essence, it's normal behavior. I normally don't pay attention to that, but a VM environment had me look at things in a different way (as opposed to doing an install on a dedicated box).

Offline didiergm

  • Sr. Member
  • ****
  • Posts: 406
Re: Memory not being returned to system?
« Reply #5 on: April 22, 2010, 02:14:23 AM »
AFAIU, Linux only releases the memory when it needs to; when memory is freed, then it is just marked as free, not counted as such; this previouslt used memory with then be allocated to a new task when needed, it is weird (compared to what Windows says for example) at the beginning but does not impact performance.

I memory was not released when needed, you'd see your system swapping like mad and slowing to a crawl as it would start using the swap (which is slower by an order of magnitude) in anger.

Didier

Offline menotu

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 15310
  • ┌∩┐(◕_◕)┌∩┐
Re: Memory not being returned to system?
« Reply #6 on: April 22, 2010, 02:40:04 AM »
One of the main (or the main) thing to consider is how your system(s) work; if they are both running smoothly I wouldn't overly worry.

On a side note, I've noticed that if close all my apps down prior to hibernating and do a "free" check, I normally have about 2.5GB free; but when I resume from hibernation I have approx 3.5GB.

How this works technically I'm unsure - I assume it does a  memory "flush" of sorts - however it does it, it most definitely works for moi!
PCLinuxOS 32bit KDE 4.10.1; kernel-3.4.11-pclos1.bfs & 64bit 3.2.18bfs; NVidia GeForce 8400GS 1GB 310.19 driver

Sony Vaio SVE1513A4ESI Laptop, Intel Core i5, 2.6GHz, 6GB RAM, 750GB, 15.6" Intel HD Graphics 4000