You are not logged in.

#1 2011-07-06 16:35:55

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

[SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

Hi Everyone,

I Don't know if this is the place to post this, and if not please correct me.

I've installed Arch Linux in a virtual machine HDD using VirtualBox on Linux Mint. Then I made a simple install with openbox and slim just to make some testes before putting the all thing in my laptop.

So after installing slim and openbox, i've checked free -m and he noticed me that the system was using 80mb of ram (really cool ^^). Then I start installing some apps just for test.

I start installing libreoffice like this "sudo pacman -S libreoffice", in a xterm terminal and on another xterm terminal I had the fallowing command running "watch free -m" just to see the ram usage evolution...


And then, during downloading/instalations, things became wierd... during download the ram usage start to grow up to 120mb and during instalation the ram usage start's growing more and more, to finish at 770mb !

I doesn't make any sense ! But I don't really know if this is a pacman, openbox or xterm problem :S...

Can someone give me any information about that ?

Thanks in advance !

PS : after a "sudo pacman -Scc" the ram drop at 633mb...

Luis Da Costa

Last edited by aliasbody (2011-07-07 18:33:56)

Offline

#2 2011-07-06 17:05:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

Please post the output of 'free -m'.

Offline

#3 2011-07-06 17:19:22

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

I've restarted the machine :S... I'm trying to reproduce the error again, but he doesn't go up more than 319 for the Memory Used and 56 for the Buffers used :S.. strange

Offline

#4 2011-07-06 17:21:30

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

Done....
Memory :
Total - 1913
Used - 679
Free - 1233
Shared - 0
Buffers - 29

-/+ buffers/cache :
total - 75
free - 1838

swap :
total - 258
used - 0
free - 258

Offline

#5 2011-07-06 17:22:16

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

Are you looking at the first or the second line of the free command's output? The second one shows actual amount of memory used by applications.

Offline

#6 2011-07-06 17:28:47

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

I know the second one shows the actual amount of memory used by applications and the first one is the allocated if I remenber, but my problem is that the first line of memory usage never grow up that fast... in this machine I have 2gb of ram just for the virtual machine, but in my netbook with 1Gb this can start using swap fast when he's really only using 60mb of ram :S...

Offline

#7 2011-07-06 17:34:26

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

I don't know why would it use swap, but if you have n GBs of RAM, why not use it all? Unused RAM is wasted RAM.

Last edited by karol (2011-07-06 17:34:59)

Offline

#8 2011-07-07 10:32:14

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

Yes but it is not normal at all, because it starts using ram. I got the proof here on my girlfriend's netbook, before makin an "sudo pacman -S package" I got 600mb of used ram and 400 of buffers now I got this :


             total       used       free     shared    buffers     cached
Mem:           996        833        163          0         46        323
-/+ buffers/cache:        463        533
Swap:         2930          3       2926


And obviously, the pc was starting to became slow because he start's using swap actively during the instalation... I know it is only 3 megabits but this can grow up more if I do more than 1 install/update :S....

Offline

#9 2011-07-07 10:40:35

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

It happens to me too sometimes: I have little RAM and when doing multiple RAM-heavy things at once I can end up with a few MB of swap used.
I use this:

swaponoff=`sudo swapoff -a && sleep 2 && sudo swapon -a'

to get rid of the swap annoyance.

Offline

#10 2011-07-07 10:53:48

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

I'm sorry, I'm not making myself clear - my problem isn't the usage of Swap itself. I know that when RAM reaches its maximum, it uses Swap. I know that. And that's not what I'm "complaining" about.

Problem is - why does updating via pacman uses so much allocated RAM? I think there's a memory leak in here somewhere and that's what I was aiming at - I'm basically asking if it's just me or if this has happened to someone else and if it's really a problem or it has a simple explanation....

Offline

#11 2011-07-07 10:58:16

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

You said that you've installed Arch in a VM, are those things happening on a bare metal install too?
The installation on your girlfriend's netbook - is it in a VM?

Offline

#12 2011-07-07 11:00:49

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

The first instalation was a Virtual Machine, but the second one, my Girldfriend's netbook, it is a atom 1.6Ghz netbook, so no VM.

Offline

#13 2011-07-07 11:41:41

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

Install dstat and run something like "dstat -dnmgs --top-bio" to observe what is happening.

Put vm.swappiness=0 in /etc/sysctl.conf if you don't like swapping. Swapping isn't necessarily evil - I prefer to have unused pages in swap.

Offline

#14 2011-07-07 13:58:01

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

aliasbody wrote:

I'm sorry, I'm not making myself clear - my problem isn't the usage of Swap itself. I know that when RAM reaches its maximum, it uses Swap. I know that. And that's not what I'm "complaining" about.

Problem is - why does updating via pacman uses so much allocated RAM? I think there's a memory leak in here somewhere and that's what I was aiming at - I'm basically asking if it's just me or if this has happened to someone else and if it's really a problem or it has a simple explanation....

Well, pacman's memory usage depends on a particular package in question. Installing TexLive, for instance, takes a tremendous amount of RAM/swap compared to netcfg. Pacman does not simply copy files, but also executes scripts.

It is not true that swap is used when the RAM is full. The kernel decides which data in RAM is relevant and the irrelevant data goes to swap, even if you have 300mb of RAM still available. /proc/sys/vm/swappiness controls this logic.

In your atom netbook you have only 3mb in swap... this can not be the cause of a slowdown.


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#15 2011-07-07 18:33:38

aliasbody
Member
From: Portugal
Registered: 2010-12-16
Posts: 157
Website

Re: [SOLVED] Big Memory Leak with Pacman - Xterm - Openbox

Leonid.I wrote:
aliasbody wrote:

I'm sorry, I'm not making myself clear - my problem isn't the usage of Swap itself. I know that when RAM reaches its maximum, it uses Swap. I know that. And that's not what I'm "complaining" about.

Problem is - why does updating via pacman uses so much allocated RAM? I think there's a memory leak in here somewhere and that's what I was aiming at - I'm basically asking if it's just me or if this has happened to someone else and if it's really a problem or it has a simple explanation....

Well, pacman's memory usage depends on a particular package in question. Installing TexLive, for instance, takes a tremendous amount of RAM/swap compared to netcfg. Pacman does not simply copy files, but also executes scripts.

It is not true that swap is used when the RAM is full. The kernel decides which data in RAM is relevant and the irrelevant data goes to swap, even if you have 300mb of RAM still available. /proc/sys/vm/swappiness controls this logic.

In your atom netbook you have only 3mb in swap... this can not be the cause of a slowdown.

Thank you for your answer this make me understand more about the all thing ^^

I was just scared about a possibile memory leak, I didn't know that pacman.

Thanks in advance for all, I will marked it as Solved then !

Offline

Board footer

Powered by FluxBB