LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-04-2011, 09:43 PM   #1
flyer103
Member
 
Registered: Mar 2010
Location: Beijing, China
Distribution: Slackware
Posts: 41

Rep: Reputation: 1
using /dev/shm


A few days ago, I saw a thread about /dev/shm and have learned that the device /dev/shm holds no less than 1/2 of the current available memory by default. In my /etc/fstab, tmpfs is set as follows:
tmpfs /dev/shm tmpfs defaults 0 0
Today, I copied gcc-4.6.0.tar.gz to /dev/shm and compiled it. But after some time, I got an error that there was no left space on the device. However, I found there was about 1.5GB memory available before compiling and during compiling, I didn't launch new tasks. I don't know why this happens. Doesn't 0.75GB memory support the compiling of gcc4.6.0?
I think after coping some software into /dev/shm, the software only has the volume of 1/2 of the current available memory by default and cann't be swapped between the hard disk and the memory. Does it right?
Thanks in advance for help.
 
Old 06-05-2011, 12:56 PM   #2
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
device /dev/shm holds no less than 1/2 of the current available memory by default
Minor correction: by default /dev/shm uses no more than one-half the RAM. The defaults can be modified. Using up to one-half does not mean half is reserved.

The special /dev/shm file system and tmpfs will use swap but I believe that applies only to shared memory segments and not to traditional files.

Occasionally some packages will not compile because of the lack of sufficient temporary storage space. I think I have run into that problem only once, maybe twice. That problem is not limited to using /dev/shm as $TMP/$TEMP/$TMPDIR. The default for those environment variables is /tmp. If /tmp is located on a separate partition, a common practice for some people, that problem could happen there too if the partition size is too small.

You did not mention the amount of RAM you have installed. I have 4 GB of RAM installed. The latest version of GCC might be one such package but I never have tried to build that package and can't say for sure. Possible simple fix: Try changing the build script to a build location that has ample storage space.

If you return to that thread you'll notice a disagreement about using /dev/shm in such a manner. Decide for yourself what is best for you.
 
Old 06-06-2011, 09:59 AM   #3
flyer103
Member
 
Registered: Mar 2010
Location: Beijing, China
Distribution: Slackware
Posts: 41

Original Poster
Rep: Reputation: 1
My RAM volume is 2GB.
Thank you very much! I have learned a lot from your and other people's posts. I didn't have the knowledge that some packages are compiled in assigned place.
 
Old 06-06-2011, 01:09 PM   #4
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
I didn't have the knowledge that some packages are compiled in assigned place.
Typical SlackBuild build scripts will have an assignment for the $TMP environment variable like this:

TMP=${TMP:-/tmp/SBo}

or

TMP=${TMP:-/tmp}

That location is where the build will take place.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Issues with /dev/pts & /dev/shm, when LFS boots zer0signal Linux From Scratch 2 12-21-2010 07:14 AM
/dev/shm not mounted /dev busy compgenius999 Linux - Newbie 1 03-03-2010 11:12 AM
Sizes of /dev /dev/shm /lib/init/rw jmoschetti45 Linux - Server 0 01-25-2010 11:20 AM
use of /dev/shm kskkumar Linux - General 1 01-31-2006 01:55 PM
What is /dev/pts, /dev/shm? mrpc_cambodia Red Hat 1 10-18-2004 03:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration