ran out of memory

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
User avatar
jpg153
Donor
Posts: 473
Joined: 23. Oct 2009, 15:43
Location: Krefeld/NRW/BRD/EU

ran out of memory

Post by jpg153 »

Hi all,

hope you all had a decent xmas.

Now in preparation for 2017 8-) I did some tidy up work today on my PC.
Both hard discs (SSD SATA and HD SCSI) were a bit loaded so I did a lot of burning CD/DVD,
moved files between those discs and uploaded some 100MB with gigolo to a webdav accessible cloud (online storage).
I also created a lot of ZIPs and deleted doubles and other files which I don't need any longer.
It is of course an incomplete (infinite?) task.
The only weird I did was to remove the image I used as background on my desktop.

Some when during those actions I recognised that the memory usage was at ~50%, which is quite significant.
But as I was doing a lot of things in parallel, I did not put much attention to it.

Finally, when closing all my jobs the system became a bit sluggish and did not respond as I expected.
I then checked with the taskmanager and memory usage was almost 100%.
Given the fact that my machine runs 16GB RAM this made me a bit scared. :shock:
Usually I never touch the 50%, even with 2 or 3 VirtualBox sessions in parallel.

The only I could recognize before the system went to a super slow motion Linux (no reacting anymore)
was that some of the gvfs tasks were occupying a lot of memory and seem not releasing it properly.

Any idea what happened and why and how to prevent thing happening again?

Thanks
Regards Gruß
jpg
westms
Posts: 298
Joined: 17. Mar 2013, 18:51

Re: ran out of memory

Post by westms »

jpg153 wrote:Hi all,

hope you all had a decent xmas.

Now in preparation for 2017 8-) I did some tidy up work today on my PC.
Both hard discs (SSD SATA and HD SCSI) were a bit loaded so I did a lot of burning CD/DVD,
moved files between those discs and uploaded some 100MB with gigolo to a webdav accessible cloud (online storage).
I also created a lot of ZIPs and deleted doubles and other files which I don't need any longer.
It is of course an incomplete (infinite?) task.
The only weird I did was to remove the image I used as background on my desktop.

Some when during those actions I recognised that the memory usage was at ~50%, which is quite significant.
But as I was doing a lot of things in parallel, I did not put much attention to it.

Finally, when closing all my jobs the system became a bit sluggish and did not respond as I expected.
I then checked with the taskmanager and memory usage was almost 100%.
Given the fact that my machine runs 16GB RAM this made me a bit scared. :shock:
Usually I never touch the 50%, even with 2 or 3 VirtualBox sessions in parallel.

The only I could recognize before the system went to a super slow motion Linux (no reacting anymore)
was that some of the gvfs tasks were occupying a lot of memory and seem not releasing it properly.

Any idea what happened and why and how to prevent thing happening again?

Thanks
One thing I know exactly, it is not a Salix problem.

Maybe the CPU burned down and now only the built-in abacus is running. Perhaps the Linux kernel has become sick. Who knows, with all that you always do. :)

But enough with messing around.
jpg153 wrote:Given the fact that my machine runs 16GB RAM this made me a bit scared.
Let me guess, you do not have a swap device in use. There is a fairy story here, that with a big main memory swap space is no longer necessary. I can not agree. And member colebaas showed that swap space is always useful:
"Why use swap? - I have plenty of RAM." viewtopic.php?f=32&t=7209&p=41769#p41769

It also depends on how the usage is. Some e-mail, watching movies and surfing the web is certainly no problem.

That would answer the first part of your question. The second part of the question can be answered by: Use swap space. Eventually, only the swap strategy needs to be adjusted.

Now and then you should follow the old German saying: "Nach einem Boot wird alles gut!" (English noun boot, of the verb "to boot"). This is from the time with Windows 95/98. Meanwhile, according to my feeling, it is also appropriate for the Linux kernel.

After booting, updates to registers / databases are running (for locate / slocate / ...), if this is set up on your system. If the process priorities are not restricted, this creates a lot of CPU, bus and HDD load. So if you changed a lot, then there was a lot to update. If the problem occurs more frequently, you can try to lower the process priority/ies. For this, the shell builtin command ulimit and the external command nice are available. On the single core system I'm writing on, the effect was so strong that I've turned off all these annoyances.

Happy New Year, to everyone!
User avatar
jpg153
Donor
Posts: 473
Joined: 23. Oct 2009, 15:43
Location: Krefeld/NRW/BRD/EU

Re: ran out of memory

Post by jpg153 »

Happy New Year!

Well,
right, I did not create a swap partition because of the 16GB RAM.
And, of course, after a reboot all is fine again - no abacus mode CPU :lol:

I will watch out if it will happen again.

Thanks.
Regards Gruß
jpg
User avatar
gapan
Salix Wizard
Posts: 6349
Joined: 6. Jun 2009, 17:40

Re: ran out of memory

Post by gapan »

Most probably a memory leak in something you were using. Browsers are the most usual culprits but it could be something else. Next time this starts happening, run htop and sort by memory use. You can then see which process consumes the most memory.
Image
Image
User avatar
jpg153
Donor
Posts: 473
Joined: 23. Oct 2009, 15:43
Location: Krefeld/NRW/BRD/EU

Re: ran out of memory

Post by jpg153 »

Thanks.

Yes, that is what I assume and will try to do.

However, where in rc.S should I place the line to start rc.zram at the right time?
Or, is it sufficient to activate it in the system services list?

Thanks in advance.
Regards Gruß
jpg
colebaas
Posts: 22
Joined: 18. Dec 2016, 10:55

Re: ran out of memory

Post by colebaas »

where in rc.S should I place the line to start rc.zram

Code: Select all

# Clean up some temporary files:
rm -f /var/run/* /var/run/*/* /var/run/*/*/* /etc/nologin \
  /etc/dhcpc/*.pid /etc/forcefsck /etc/fastboot \
  /var/state/saslauthd/saslauthd.pid \
  /tmp/.Xauth* 1> /dev/null 2> /dev/null
  ( cd /var/log/setup/tmp && rm -rf * )
  ( cd /tmp && rm -rf kde-[a-zA-Z]* ksocket-[a-zA-Z]* hsperfdata_[a-zA-Z]* plugtmp* )

# Clear /var/lock/subsys:
if [ -d /var/lock/subsys ]; then
  rm -f /var/lock/subsys/*
fi

######   start own zram0 /tmp
if [ -x /etc/rc.d/rc.zram ]
then
	sh  /etc/rc.d/rc.zram start
fi
#########################

# Create /tmp/{.ICE-unix,.X11-unix} if they are not present:
if [ ! -e /tmp/.ICE-unix ]; then
  mkdir -p /tmp/.ICE-unix
  chmod 1777 /tmp/.ICE-unix
fi
if [ ! -e /tmp/.X11-unix ]; then
  mkdir -p /tmp/.X11-unix
  chmod 1777 /tmp/.X11-unix
fi

# Create a fresh utmp file:
touch /var/run/utmp
chown root:utmp /var/run/utmp
chmod 664 /var/run/utmp

... somewhere between lines 400-420. - Assuming an unaltered rc.S from current.
See the sample above for the exact location.

p.s. Based on your problem description, it is possible that you may have tried to back up the gvfs itself (entire volumes) which is a frequent mistake. Otherwise it is just not that easy to "ran out of memory".
User avatar
jpg153
Donor
Posts: 473
Joined: 23. Oct 2009, 15:43
Location: Krefeld/NRW/BRD/EU

Re: ran out of memory

Post by jpg153 »

Thanks.

Well I was on the right track but not there; I tried it some lines above (~360s).
I will give it a try later on.

Running it from the system services (startup) list was a bad idea. X did not start and the system was looping at login :cry:

Re the memory issue: no, I did not backup a whole drive/partition but big parts of them.
Moving files (lots) between directories and drives, building ZIPs and burning CDs/DVDs, but no full backup.

Thanks again.
Regards Gruß
jpg
Post Reply