Discussion:
Is 2G RAM enough?
(too old to reply)
notbob
2019-10-15 20:35:14 UTC
Permalink
I have an old Vaio (Sony) XP P4 box, running Slackware 14.1. It now has .5G of RAM (PC133)
and the mobo will only take 2 Gs max. My main problem is "un-able to
view Youtube". Will 2 Gs of RAM work OK?

($100USD per G, 10 yrs ago. Now, 2Gs fer $30USD). ;)

nb
Rich
2019-10-15 20:53:49 UTC
Permalink
Post by notbob
I have an old Vaio (Sony) XP P4 box, running Slackware 14.1. It now has .5G of RAM (PC133)
and the mobo will only take 2 Gs max. My main problem is "un-able to
view Youtube". Will 2 Gs of RAM work OK?
Without specifics of "un-able to view Youtube" it is impossibe for us to
say accurately.

If your "unable" is caused by out of memory - then more memory might
help.

But if your "unable" is caused by too little cpu power, then more
memory will to nothing to help.

Try taking the browser out of the picture with youtube-dl:
http://slackbuilds.org/repository/14.2/network/youtube-dl/
and then using mplayer to try to play the downloaded file.

If you can't play a downloaded youtube video with mplayer because of
lack of CPU power, then no amount of extra memory will help.
notbob
2019-10-16 15:43:01 UTC
Permalink
Post by Rich
Without specifics of "un-able to view Youtube" it is impossibe for us to
say accurately.
If your "unable" is caused by out of memory - then more memory might
help.
But if your "unable" is caused by too little cpu power, then more
memory will to nothing to help.
http://slackbuilds.org/repository/14.2/network/youtube-dl/
and then using mplayer to try to play the downloaded file.
If you can't play a downloaded youtube video with mplayer because of
lack of CPU power, then no amount of extra memory will help.
Good points, all!

I tried an MP4 file in gmplayer and it played jes fine. ;)

I figured "memory" cuz Youtube usta work fine. Now, it is so slow, it
doesn't fly at all. I figured it was cuz "video" had become so much
more "intensive" (higher res, higher load, higher "U-name-it", etc).

nb
Rich
2019-10-16 16:02:37 UTC
Permalink
Post by notbob
Post by Rich
Without specifics of "un-able to view Youtube" it is impossibe for us to
say accurately.
If your "unable" is caused by out of memory - then more memory might
help.
But if your "unable" is caused by too little cpu power, then more
memory will to nothing to help.
http://slackbuilds.org/repository/14.2/network/youtube-dl/
and then using mplayer to try to play the downloaded file.
If you can't play a downloaded youtube video with mplayer because of
lack of CPU power, then no amount of extra memory will help.
Good points, all!
I tried an MP4 file in gmplayer and it played jes fine. ;)
Was it a youtube video or just a generic MP4 file?

Because if it was *not* a youtube video you've not proven you have
enough CPU to play /youtube/ videos.
Post by notbob
I figured "memory" cuz Youtube usta work fine. Now, it is so slow,
it doesn't fly at all. I figured it was cuz "video" had become so
much more "intensive" (higher res, higher load, higher "U-name-it",
etc).
This is likely the cause, but, remember the browser is also normally
involved, which adds extra overhead. So you may not have enough CPU to
play youtube /in a browser/ because of the browser overhead.

But until you do this:

1) download a youtube video that fails to play in the browser with
youtube-dl
2) play the downloaded video and see how well it works, or does not
work

you still have not done a proper test to determine if you can even play
the video without the browser overhead in the first place.
notbob
2019-10-17 18:38:25 UTC
Permalink
Post by Rich
Post by notbob
I figured "memory" cuz Youtube usta work fine. Now, it is so slow,
it doesn't fly at all. I figured it was cuz "video" had become so
much more "intensive" (higher res, higher load, higher "U-name-it",
etc).
This is likely the cause, but, remember the browser is also normally
involved, which adds extra overhead. So you may not have enough CPU to
play youtube /in a browser/ because of the browser overhead.
Did it.

The MP4 (MP4 works fine) was from an old Youtube-dl file that was dwnld'd about the
time of the "great slowdown". I recall when Youtube-dl files usta be
all MP4's, then changed to some proprietary Winblows format, which I
don't think I can play. I don't recall.

The old Youtube-dl init file was still in that same dir. ;)

nb
Rich
2019-10-17 18:54:08 UTC
Permalink
Post by notbob
Post by Rich
Post by notbob
I figured "memory" cuz Youtube usta work fine. Now, it is so slow,
it doesn't fly at all. I figured it was cuz "video" had become so
much more "intensive" (higher res, higher load, higher "U-name-it",
etc).
This is likely the cause, but, remember the browser is also normally
involved, which adds extra overhead. So you may not have enough CPU to
play youtube /in a browser/ because of the browser overhead.
Did it.
The MP4 (MP4 works fine) was from an old Youtube-dl file that was
dwnld'd about the time of the "great slowdown". I recall when
Youtube-dl files usta be all MP4's, then changed to some proprietary
Winblows format, which I don't think I can play. I don't recall.
The old Youtube-dl init file was still in that same dir. ;)
The -f and companion -F CLI options to youtube-dl allows you to pick
the type of file you want to download from youtube. Downloading an MP4
might allow you to continue to 'watch' these videos because they will
not be the "newest version" that the browser tries to play, but does
not have the power with only a P4 CPU supporting it.

Youtube in the web browser is probably trying to play the 'best
compression' (which for your use also means "most difficut to
decompress") because the 'best compression' for youtube lowers their
bandwidth consumption.

So you might have to start downloading mp4's using youtube-dl instead
of trying to watch from a browser if you plan to continue to use a P4
CPU to play the videos.
notbob
2019-10-17 19:09:26 UTC
Permalink
Post by Rich
So you might have to start downloading mp4's using youtube-dl instead
of trying to watch from a browser if you plan to continue to use a P4
CPU to play the videos.
Not a problem. Thnx fer the tip (-f fer Youtube-dl file).

I still think I will buy the two 1G memory sticks. Only
$24USD-$50USD, now. ;)

nb
Rich
2019-10-17 19:24:35 UTC
Permalink
Post by notbob
Post by Rich
So you might have to start downloading mp4's using youtube-dl instead
of trying to watch from a browser if you plan to continue to use a P4
CPU to play the videos.
Not a problem. Thnx fer the tip (-f fer Youtube-dl file).
Note that the -F option will allow you to view what file formats are
available to then pick out the one you want to download.
Post by notbob
I still think I will buy the two 1G memory sticks. Only
$24USD-$50USD, now. ;)
More memory will do no harm. But if the issue is that a P4 is too week
to play the version that the in-browser player wants to play, it will
also not help (for playing in a browser).
dillinger
2019-10-18 14:29:29 UTC
Permalink
Post by notbob
Post by Rich
So you might have to start downloading mp4's using youtube-dl instead
of trying to watch from a browser if you plan to continue to use a P4
CPU to play the videos.
Not a problem. Thnx fer the tip (-f fer Youtube-dl file).
I still think I will buy the two 1G memory sticks. Only
$24USD-$50USD, now. ;)
nb
Is it worth it? For $50USD you probably could pick up a computer twice
as fast, with 4G of ram and maybe even decent graphics.
John McCue
2019-10-16 00:51:18 UTC
Permalink
Post by notbob
I have an old Vaio (Sony) XP P4 box, running Slackware 14.1.
It now has .5G of RAM (PC133)
and the mobo will only take 2 Gs max. My main problem is "un-able to
view Youtube". Will 2 Gs of RAM work OK?
($100USD per G, 10 yrs ago. Now, 2Gs fer $30USD). ;)
nb
Well I have tried FF on an 32 bit OpenBSD system with 2G
memory, and it is somewhat slow with Firefox running.

With youtube, I would think it would be skippy at best :)
But with 2G, it maybe useful fir other things.

John
Martha Adams
2019-10-16 01:42:55 UTC
Permalink
Post by John McCue
Post by notbob
I have an old Vaio (Sony) XP P4 box, running Slackware 14.1.
It now has .5G of RAM (PC133)
and the mobo will only take 2 Gs max. My main problem is "un-able to
view Youtube". Will 2 Gs of RAM work OK?
($100USD per G, 10 yrs ago. Now, 2Gs fer $30USD). ;)
nb
Well I have tried FF on an 32 bit OpenBSD system with 2G
memory, and it is somewhat slow with Firefox running.
With youtube, I would think it would be skippy at best :)
But with 2G, it maybe useful fir other things.
John
====================================

My applications are a now-older eMachines machine with 2 Gb
of ram running Slackware 14.1. I use emacs and Firefox
and not much else. This and similar earlier setups have
served me without any problems for more than 30 years past.

Oops, add to list, Thunderbird for email, usenet. My
eMachines is a 64-bits environment.

Titeotwawki -- Martha Adams [Tues 2019 Oct 15]
Jimmy Johnson
2019-10-18 05:10:35 UTC
Permalink
Post by John McCue
Post by notbob
I have an old Vaio (Sony) XP P4 box, running Slackware 14.1.
It now has .5G of RAM (PC133)
and the mobo will only take 2 Gs max. My main problem is "un-able to
view Youtube". Will 2 Gs of RAM work OK?
($100USD per G, 10 yrs ago. Now, 2Gs fer $30USD). ;)
nb
Well I have tried FF on an 32 bit OpenBSD system with 2G
memory, and it is somewhat slow with Firefox running.
With youtube, I would think it would be skippy at best :)
But with 2G, it maybe useful fir other things.
I have a lanovo think pad with 2gb ram, it's one of the first duo cores,
it runs 14.2-64 ok, stable, installing a older version of ffox helps and
using noscript helps, block google and use duckduckgo.com. And of course
swap space helps too.
--
Jimmy Johnson

Slackware64 Current - KDE 4.14.38 - EXT4 at sda5
Registered Linux User #380263
Lew Pitcher
2019-10-17 18:59:54 UTC
Permalink
Post by notbob
I have an old Vaio (Sony) XP P4 box, running Slackware 14.1. It now has .5G of RAM (PC133)
and the mobo will only take 2 Gs max. My main problem is "un-able to
view Youtube". Will 2 Gs of RAM work OK?
($100USD per G, 10 yrs ago. Now, 2Gs fer $30USD). ;)
As my desktop machine, I run Slackware 13.37 on an AMD with 4Gb memory.
My typical use is simultaneous web browsing, email, and usenet, with some
program editing, etc. on the side. I often watch Youtube videos with this
setup.

My memory usage rarely peaks over 2.5Gb; here's a quick look at my "free",
while I'm watching a Youtube video"

14:58 $ free -g
total used free shared buffers cached
Mem: 3 2 0 0 0 1
-/+ buffers/cache: 1 2
Swap: 16 0 16

Note that, while I /do/ have swapspace, the system does not need to use it.

You probably can get away with 2Gb, as long as you have adequate swap space.
--
Lew Pitcher
"In Skills, We Trust"
notbob
2019-10-22 18:20:23 UTC
Permalink
Post by Lew Pitcher
You probably can get away with 2Gb, as long as you have adequate swap space.
Twice RAM, as recommended. I have room fer 4G swap space. ;)

Lew, I wanna change my W10 box (uefi, 64-bit, 1T DMM) over to a BIOS box, so I
can, at least!, dual-boot Slackware Linux. 14.1, 14.2, current, etc,
I could give a rat's ass!

I don't even care if I lose W10, altogether! It's CRAP!! ;)

nb
Bubulcus Industrius
2019-10-23 10:07:49 UTC
Permalink
Post by notbob
Post by Lew Pitcher
You probably can get away with 2Gb, as long as you have adequate swap space.
Twice RAM, as recommended. I have room fer 4G swap space. ;)
I've always heard this recommendation for Windows boxes. As far as my experience
goes, Linux can do without any swap, as long as you don't run applications that
need more ram than what's available.
Swapping when you still have free ram is a waste of time and resources.

Writing from 8GB ram and no swap at all:

***@slackbox:~$ sudo free -h

total used free shared buff/cache available
Mem: 7.8Gi 1.4Gi 1.5Gi 99Mi 4.8Gi 5.8Gi
Swap: 0B 0B 0B
Richard Kettlewell
2019-10-23 10:58:30 UTC
Permalink
Post by Bubulcus Industrius
Post by notbob
Post by Lew Pitcher
You probably can get away with 2Gb, as long as you have adequate swap space.
Twice RAM, as recommended. I have room fer 4G swap space. ;)
I've always heard this recommendation for Windows boxes. As far as my
experience goes, Linux can do without any swap, as long as you don't
run applications that need more ram than what's available. Swapping
when you still have free ram is a waste of time and resources.
If you are going to hibernate then you need enough swap for the system’s
memory image.

Otherwise, _large_ swap spaces are not normally very useful. If your
working set exceeds physical RAM then your computer is going to become
very slow indeed.

A small amount of swap is nevertheless useful. A few pages do get
dirtied but then not accessed again. If they continue to occupy RAM
(that could be better used for live pages) then that RAM is just
wasted. For example this system is obviously not experiencing serious
memory pressure (plenty of free memory) but it has still evicted a few
megabytes to swap:

total used free shared buff/cache available
Mem: 8093252 1481340 266308 118400 6345604 6187388
Swap: 1048572 52480 996092

This one was going to be an example too but 4G swap used is a bit more
than I expected, so maybe this one is actually experiencing some memory
pressure.

total used free shared buff/cache available
Mem: 32785908 19237708 613032 677752 12935168 12416248
Swap: 8388604 4970772 3417832
--
https://www.greenend.org.uk/rjk/
Bubulcus Industrius
2019-10-23 12:48:56 UTC
Permalink
Post by Richard Kettlewell
If you are going to hibernate then you need enough swap for the system’s
memory image.
Agreed.
Post by Richard Kettlewell
A small amount of swap is nevertheless useful. A few pages do get
dirtied but then not accessed again. If they continue to occupy RAM
(that could be better used for live pages) then that RAM is just
wasted.
Obviously if your used memory exceeds available ram you'll need swap. As long as
you have ram for live pages, swap is useless. How often do you fill 8G of ram?
I've never gotten even close to it, running Libreoffice on KDE and other stuff.
The only software I met asking for more ram was Android Studio, and I gave it a
swap file to dance on.
Post by Richard Kettlewell
For example this system is obviously not experiencing serious
memory pressure (plenty of free memory) but it has still evicted a few
total used free shared buff/cache available
Mem: 8093252 1481340 266308 118400 6345604 6187388
Swap: 1048572 52480 996092
...which in this case was a complete waste of time and r/w cycles on disk. Why
bother writing 52M on disk while leaving 100 times that much doing nothing on ram?
Post by Richard Kettlewell
This one was going to be an example too but 4G swap used is a bit more
than I expected, so maybe this one is actually experiencing some memory
pressure.
total used free shared buff/cache available
Mem: 32785908 19237708 613032 677752 12935168 12416248
Swap: 8388604 4970772 3417832
Memory pressure, with 12G available ram, while you are swapping only 5G? With no
swap at all, you would still have more than 7G of ram sitting around doing
nothing. Do you like to watch disks spinning? :-)
Jim Diamond
2019-10-28 23:33:34 UTC
Permalink
Post by Bubulcus Industrius
A small amount of swap is nevertheless useful. A few pages do get
dirtied but then not accessed again. If they continue to occupy RAM
(that could be better used for live pages) then that RAM is just
wasted.
Obviously if your used memory exceeds available ram you'll need
swap. As long as you have ram for live pages, swap is useless.
? What do you mean by "live" pages. What about, as Richard
mentioned, dirty pages that have not been used for a while? (Since,
in general, the OS can't tell whether the page is going to be used again.)
Post by Bubulcus Industrius
How often do you fill 8G of ram? I've never gotten even close to
it, running Libreoffice on KDE and other stuff. The only software I
met asking for more ram was Android Studio, and I gave it a swap
file to dance on.
For example this system is obviously not experiencing serious
memory pressure (plenty of free memory) but it has still evicted a few
total used free shared buff/cache available
Mem: 8093252 1481340 266308 118400 6345604 6187388
Swap: 1048572 52480 996092
...which in this case was a complete waste of time and r/w cycles on
disk.
You can't say that without knowing that the processes on his computer
were doing in the past, when larger memory usage might have caused the
kernel to swap out some pages.
Post by Bubulcus Industrius
Why bother writing 52M on disk while leaving 100 times that much
doing nothing on ram?
Because of reasons like the one I mentioned.
Post by Bubulcus Industrius
This one was going to be an example too but 4G swap used is a bit more
than I expected, so maybe this one is actually experiencing some memory
pressure.
total used free shared buff/cache available
Mem: 32785908 19237708 613032 677752 12935168 12416248
Swap: 8388604 4970772 3417832
Memory pressure, with 12G available ram, while you are swapping only
5G? With no swap at all, you would still have more than 7G of ram
sitting around doing nothing.
At the moment he ran free, yes.
Post by Bubulcus Industrius
Do you like to watch disks spinning? :-)
Perhaps he has SSDs.

In any case, if you think the Linux memory manager is doing all the
wrong things, you should consider sharing your knowledge with Linus
and the other kernel developers so we can all benefit from your
knowledge. I certainly would like better performance on all my
systems, and I bet lots of other people would too.

Jim
Henrik Carlqvist
2019-10-23 12:31:12 UTC
Permalink
Post by Bubulcus Industrius
Post by notbob
Twice RAM, as recommended.
I've always heard this recommendation for Windows boxes.
The rule of thumb with twice the amount of RAM for swap space used to
apply to some older unix implementations were the swap area became the
working memory of the machine and the RAM was only used as caching the
disk (swap + storage).

With Linnux your working memory becomes the sum of RAM+swap. Still, as
Richard wrote, it is good to have at least some swap for seldomly used
memory which can get swapped out and leave more RAM for disk cache.

regards Henrik
Richard Kettlewell
2019-10-23 12:55:11 UTC
Permalink
Post by Henrik Carlqvist
Post by Bubulcus Industrius
Post by notbob
Twice RAM, as recommended.
I've always heard this recommendation for Windows boxes.
The rule of thumb with twice the amount of RAM for swap space used to
apply to some older unix implementations were the swap area became the
working memory of the machine and the RAM was only used as caching the
disk (swap + storage).
What implementation would that be?

I think it’s more likely that large swap spaces were specified to avoid
bogus out-of-memory errors on implementations that didn’t overcommit
(which does include Linux if you turn overcommit off).
--
https://www.greenend.org.uk/rjk/
notbob
2019-10-23 14:45:29 UTC
Permalink
Post by Richard Kettlewell
Post by Henrik Carlqvist
The rule of thumb with twice the amount of RAM for swap space used to
apply to some older unix implementations were the swap area became the
working memory of the machine and the RAM was only used as caching the
disk (swap + storage).
What implementation would that be?
I first heard it on an early version of Red Hat, when I fist got into
Linux (pre-5.1). That was when you still got "manuals" with yer
distro. ;)

nb
Henrik Carlqvist
2019-10-23 15:50:41 UTC
Permalink
Post by Richard Kettlewell
Post by Henrik Carlqvist
The rule of thumb with twice the amount of RAM for swap space used to
apply to some older unix implementations were the swap area became the
working memory of the machine and the RAM was only used as caching the
disk (swap + storage).
What implementation would that be?
If I remember right that memory model and rule of thumb applied to SunOS
4 (the older BSD-ish version of Solaris), it might also have applied to
other unixes from that era.

regards Henrik
Rich
2019-10-23 15:56:44 UTC
Permalink
Post by Richard Kettlewell
Post by Henrik Carlqvist
Post by Bubulcus Industrius
Post by notbob
Twice RAM, as recommended.
I've always heard this recommendation for Windows boxes.
The rule of thumb with twice the amount of RAM for swap space used to
apply to some older unix implementations were the swap area became the
working memory of the machine and the RAM was only used as caching the
disk (swap + storage).
What implementation would that be?
At some point in the early 2.0 or 2.1 Linux kernel there was some
change made to the memory paging subsystem in the kernel that resulted
in a "make swap be at least 2x RAM" a highly suggested configuration.
I long since have forgotten the reasons why at least 2x RAM was
magical, or necessary, but the legacy of that suggestion continues to
pop up to this day, long after the suggestion has no longer been valid.
Ander GM
2019-11-25 18:56:00 UTC
Permalink
Post by notbob
I have an old Vaio (Sony) XP P4 box, running Slackware 14.1. It now has .5G of RAM (PC133)
and the mobo will only take 2 Gs max. My main problem is "un-able to
view Youtube". Will 2 Gs of RAM work OK?
($100USD per G, 10 yrs ago. Now, 2Gs fer $30USD). ;)
nb
Add ZRAM. My /etc/rc.d/rc.zram file (chmod +x it).

It adds a GB by default, change SIZE to 2048 in
order to get 2GB.

#!/bin/bash
# Script to start zRam (Virtual Swap Compressed in RAM)
# https://github.com/otzy007/enable-zRam-in-Slackware
#
# Size of swap space in MB
# default 1GB
SIZE=1024

start() {
modprobe zram
echo $SIZE*1024*1024 | bc > /sys/block/zram0/disksize
mkswap /dev/zram0
swapon /dev/zram0
}

stop() {
swapoff /dev/zram0
}

case "$1" in
start)
start
;;

stop)
stop
;;

restart)
echo 1 > /sys/block/zram0/reset
;;

*)
echo "Usage: $0 (start|stop|restart)"
esac

Loading...