system freeze when the RAM is full

Booting, installing, newbie
Post Reply
Message
Author
eadmaster
Posts: 46
Joined: Sat 09 Feb 2013, 11:34
Contact:

system freeze when the RAM is full

#1 Post by eadmaster »

I'm using Upup Precise 3.8.2 booting from an USB pendrive since last year.

Recently i am getting frequent freezes during internet browsing.
I guess the cause is my browser (Firefox) requesting too much RAM:
it usually happens while buffering HD flash videos or when i have many tabs opened. The GUI became very unresponsive and sometimes i can't even kill the X server with Ctrl+Alt+Backspace (i can only reboot the machine and lose all the unsaved data...).

p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

#2 Post by p310don »

When you run out of ram, you could be out of luck...

To safeguard against such losses of luck, make sure you have a decent sized swap partition to take up the slack when your RAM is full.

eadmaster
Posts: 46
Joined: Sat 09 Feb 2013, 11:34
Contact:

#3 Post by eadmaster »

since i'm booting from USB i have no swap partition.. what safeguard does puppy employ to prevent exceeding the available RAM?

As alternative, i'm thinking about limiting the max memory the system will allocate to Firefox...

p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

#4 Post by p310don »

Do you own the PC?
Does it have a hard drive?

If yes x2, you could put on a swap partition. I think you can make a swap partition on a USB drive, although it wouldn't be too good for the drive.

If not, try your idea.

eadmaster
Posts: 46
Joined: Sat 09 Feb 2013, 11:34
Contact:

#5 Post by eadmaster »

I would like to avoid creating a swap partition for various reasons... any other solution?

User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

#6 Post by OscarTalks »

Maybe you could try a swap file.
If it has to be a case of everything within the flash drive this is far from ideal, but you have little choice.
Memory is one of those essential components needed to perform a task.
When you run out, the system can only freeze or crash.
If you can find a way of restricting the application's access to the memory the problem is that you still will not have enough memory for the task.
Otherwise, add more RAM to the machine.
Oscar in England
Image

User avatar
Packetteer
Posts: 73
Joined: Sat 12 May 2012, 19:33
Location: Long Island Ny

#7 Post by Packetteer »

Hi eadmaster
You need to change your profile in FireFox to save its cash in a temp
directory. I have SeaMonkey save its cash to a temp directory so my save file
stays small. Yes the temp directory is held in ram and yes after many hours
of surfing the net I also run out of Ram.
Slacko 5.7 has a nice feature. When Slacko 5.7 runs low on ram a popup
warning message is displayed which alerts me to the fact I need to close all
applications and then gracefully shut down the machine. Which since it is a
graceful shut down I lose nothing.

As I said I changed my profile in SeaMonkey so SeaMonkey saves its cash to
a temp file (/tmp). /tmp is in ram. In your case you could setup FireFox to
save its cash to your hard drive thus avoiding using ram for FIreFox's cash.

I use /temp because I try to avoid having my hard drive mounted as much as
possible especially while surfing the web. I do this for security reasons.

Best Regards
John

User avatar
neerajkolte
Posts: 516
Joined: Mon 10 Feb 2014, 07:05
Location: Pune, India.

#8 Post by neerajkolte »

Hi I do not use upup.

I use fatdog64. In fatdog you can split your humongous initrd in small initrd and base.sfs then choose not to load base.sfs and savefile in ram by giving some boot options. It uses them directly from disc.

I am at work now and don't remember the boot options.

But if same is available you might save some ram by sacrificing some speed.

Then again I am just a new noob. I might be wrong.


- Neeraj.
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson

“We tend to overestimate the effect of a technology in the short run and underestimate the effect in the long run.â€￾
- Amara’s Law.

r__hughes
Posts: 359
Joined: Thu 13 Apr 2006, 04:14
Location: Montreal, Canada

#9 Post by r__hughes »

I'm using Slacko56npae frugal on a laptop, and on a USB for use on other computers. The built in Firefox is version 17.0.8 and I have reduced the cache requirement to 15Mb (Edit/preferences/Advanced/Override Automatic cache requirement).

Firefox seems to work fine with this reduction.
--- quad booting Slacko57NPAE, Slacko56NPAE, Slacko55PAE (with OO4, devx, Gimp) & WXP on DELL Dimension 2400 PC & DELL Latitude 630 Laptop using grub.
---USB-Flash booting same on Samsung N110 WXP Netbook and Lenovo q100 WXP netPC.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#10 Post by mikeb »

Firefox works perfectly with 0MB cache...done it for years since I don't have dial up which seems to be the only valid reason to have cache at all.

The urlclassifier files also get big. Beyond that you have to try and tame the sqlite files but their defaults are big now for no goot technical reason....all the info is easily searchable either here or on the net.

mike

eadmaster
Posts: 46
Joined: Sat 09 Feb 2013, 11:34
Contact:

#11 Post by eadmaster »

Thank you for your suggestions, these are my internal firefox settings:

Code: Select all

browser.cache.disk.enable;false
browser.cache.memory.enable;true
browser.sessionhistory.max_total_viewers;0
network.prefetch-next;false
browser.cache.use_new_backend;0
browser.cache.memory.capacity;0
Also i guess i need to reduce the Flash cache separately..

My persistent data image is 700MB big, so avoiding full RAM loading would help greatly, but I could not find such an option in this page.
Btw there is an option "pfix=nocopy" to keep the main SFS on disk, which now i've set.

Side question: do extra SFSes are also entirely loaded in RAM by default?

gcmartin

#12 Post by gcmartin »

Hi @EADmaster

Very good advice from members.

3 Questions to help us
  • What PC CPU and how much RAM do you have?
  • Does the PC have an internal HDD?
Here to help

Peterm321
Posts: 411
Joined: Thu 29 Jan 2009, 14:09
Location: UK

#13 Post by Peterm321 »

If you are booting from USB flash then creating or using a swap file on it could be a bad idea as this kind of media is less tolerant of many write cycles compared with traditional platter magnetic media.

Firefox has the facility to move the contents of the cache directory:

Code: Select all

about:config
browser.cache.disk.parent_directory
BTW I would disable memory caching for firefox but enable disk caching. That said, I would ensure that the caching parent directory is set to /tmp (which should be mounted as tmpfs). The max size of the cache I would set to a small percentage of system ram perhaps just one or two percent. Flash and more or less anything of that kind is also probably using the /tmp directory or a subdir to cache a video as it is playing. This may be more a reason why memory gets filled as videos tend to be larger than web pages.

I would check the output of the "mount" command, typed at in a terminal window without parameters it should say how /tmp is mounted. (see also the file /proc/mounts).

On my system /tmp is mounted as tmpfs

Code: Select all

mount -t tmpfs -o size=250m tmpfs /tmp

My own preference is for /tmp to be mounted as tmpfs with a fixed size. At least anything writing to it will run out of space sooner than run out of memory.

For me

Code: Select all

mount /tmp -o remount,size=250m 
sets my /tmp tmpfs to fixed size 250 Megabytes (as an example) so should be enough for most videos. Of course you will need enough memory for a tmpfs, a tmpfs can only use a certain amount of system ram as the rest will be needed by the kernel and applications. tmpfs can also use swap (if available) however swap will likely use a fair number of write cycles.

eadmaster
Posts: 46
Joined: Sat 09 Feb 2013, 11:34
Contact:

#14 Post by eadmaster »

My PC has a 4GB memory stick. I'm planning to get another 4GB memory stick, but not now...
Also i will need to switch to a PAE-enabled Puppy build to make use of all the memory (i'd like to avoid 64-bit build because they take twice space for the runtime libraries).

Btw there is no internal had disk. When needed i connect an external hard disk (a Samsung FreeAgent Goflex) via an hacked SATA cable, but i don't want to do that just for the swap partition...

After adding the "pfix=nocopy" command now I have 1.1GB of memory free according to the "free" command.
Do you suggest me to unload some unnecessary SFS files to free up more or it won't change anything?

According to mount, the /tmp partition is like this:

Code: Select all

tmpfs on /initrd/pup_rw type tmpfs (rw,relatime,size=1553964k)
I dont know if "size=1553964k" means it is already limited. If it does not, where i should put the remount command in order to not break anything at boot time?

As suggested i will now try disabling the FF memory cache and switch to disk caching and see what happens...

p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

#15 Post by p310don »

Couple of thoughts...

If your PC has 4 gig, but you're not using PAE or 64bit, you've probably only got 3ish gig to play with. So PAE or 64bit is possibly your solution on its own.

Also, if no hard drive, you could use a second usb drive just for swap.

eadmaster
Posts: 46
Joined: Sat 09 Feb 2013, 11:34
Contact:

#16 Post by eadmaster »

p310don wrote:Couple of thoughts...

If your PC has 4 gig, but you're not using PAE or 64bit, you've probably only got 3ish gig to play with. So PAE or 64bit is possibly your solution on its own.
Yep i knew that, but for the moment i would like to stay with this build. I am going to switch to TahrPup as soon as they get the AMD drivers working...
While we are on topic, since i have no discrete graphics card, do the shared graphics memory is allocated inside or outside the system-accessible area?
Can i customize the amount of memory that is reserved for the GPU? (i am currently using the "amd_fglrx_catalyst-13.1-k3.8.2-upup" drivers)

I would like to avoid using a second pendrive for the swap for the same reason Peterm321 told before (limited write cycles).

p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

#17 Post by p310don »

That is beyond my level of expertise, but I think shared memory is allocated in the BIOS? Worth looking into

eadmaster
Posts: 46
Joined: Sat 09 Feb 2013, 11:34
Contact:

#18 Post by eadmaster »

there is no such option in the BIOS, i've already checked some time ago.
On Windows i've found it is regulated dynamically.
In the Catalyst Control Center it is possible to view the current shared memory size, but not changing it.

Peterm321
Posts: 411
Joined: Thu 29 Jan 2009, 14:09
Location: UK

#19 Post by Peterm321 »

eadmaster Today, at 00:35 wrote:
According to mount, the /tmp partition is like this:

Code: Select all

	
tmpfs on /initrd/pup_rw type tmpfs (rw,relatime,size=1553964k)
Interesting. My own computer has a similar entries for initrd tmpfs (as I have a frugal install) and I had not amended these to limit the amount of ram. (I am just now amending my startup scripts to put a limit on the initrd tmpfs as well)

However I have for nearly as long as I have used upup Raring explicitly mounted and limited the /tmp directory. Unless your /proc/mounts file shows a specific reference that begins with /tmp e,g

/tmp tmpfs (rw, ...... size=NNNNNNk)

Then it does not appear that /tmp has been specifically mounted. By the way, the 1553964k refers to

1,553,964 Kilobytes or in other words circa 1.5 Gigabytes of memory. Playing long videos could possibly fill this up, thats a lot of video though unless its HD you are using.

Maybe limit it by half and see if there is any benefit?

Code: Select all

mount /initrd/pup_rw -o remount,size=750m
As a personal preference I wouldnt prefer PAE and/or 64 Bit unless I had more than 4GB memory on my computer.

On another point I have a radeon card but use the open source driver that is bundled with Raring rather than the fglrx driver. That said I'm not using Puppy to play 3D games.

I have had some issues in the past, relating to kernel panics in the drm_kms_helper module, this module appears to be sensitive to the system running out of memory. The open source driver (so I would hope the proprietary driver), has tunables in the file:

/etc/modprobe.d/radeon.conf

The tunables include the gartsize (the memory used by the graphics chip). See also the kernel variable in the folder

/sys/module/radeon/parameters/

Originally 128 Mbytes, I set the gartsize to 32 (32 = 32 megabytes). It doesnt appear to affect the ability to play DVDs and MP4s so it may be worth seeing if you can set the gartsize and if so set it to 32 without adverse effect. If I rightly recall there is also an "option gartsize" that can be inserted into xorg.conf though I have rather set it in radeon.conf.

Post Reply