LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-15-2011, 11:22 AM   #1
pawoseyi
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Rep: Reputation: 0
How to allocate maxmem in Linux?


In Windows this done in the boot.ini file or by using a Windows utility called bcdedit.
bcdedit /set TRUNCATEMEMORY the_mem_size

Does anyone know how to issue a similar command under Linux. An example under Linux will be appreciated...
 
Old 07-15-2011, 01:45 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,577
Blog Entries: 14

Rep: Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969Reputation: 969
What exactly does setting maxmem do in Windows? That is to say does it limit the amount of memory used over all in a system? Used by a single process? Used by a single user? Is it system memory (RAM)? Network memory? Something else? What exactly do you want to limit the memory for - a specific application? Does it use shared memory structures on Linux?

There are various memory settings available in UNIX/Linux and what you need to set depends a lot on what you're doing.
You could type "man sysctl" for a good overview of System kernel/network settings that are available.
 
0 members found this post helpful.
Old 07-15-2011, 07:57 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
If you wish to limit the (total) memory the kernel sees (and uses) merely pass a parameter to it (the kernel) via your bootloader.
mem=nn[KMG]
 
1 members found this post helpful.
Old 07-17-2011, 05:06 PM   #4
pawoseyi
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Yes indeed - I need to limit the (total) memory the kernel sees (and uses). Follow-up question, is the "bootloader" you referenced a file? What is the name and where is it located in Linux?? Is obvious I am a neophyte in Linux and so I crave your indulgence - pardon my ignorance...:-)
 
Old 07-17-2011, 06:56 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
All bootloaders use a configuration file - boot.ini in the Windows case. Linux offers more than one bootloader - as you've given no indication of your distribution and version it's hard to guess which you might be using.
 
Old 07-18-2011, 01:59 PM   #6
pawoseyi
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Talking Re: How to allocate maxmem in Linux?

Accept my apologies - The versions of interest are RHEL6.0 x86-64 and SLES11 SP1 x86-64. Thx in advance...
 
Old 07-18-2011, 04:11 PM   #7
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,200

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
more than likely the file would be

/boot/grub/grub.conf, /boot/grub/grub.cfg or /boot/grub/menu.lst

the section you are looking for would look something approximately like
Code:
title Fedora (2.6.38.8-35.fc15.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.38.8-35.fc15.x86_64 ro root=UUID=4ebe0939-5dba-4f1b-9fb0-dc8223eb7d28 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us nomodeset vga=791 video=nvidiafb
my system is Fedora linux, so the label will be different on yours but the structure/syntax will be the same

you would simply add
Code:
mem=nn[KMG]
to the end of the line that begins with the word 'kernel' (the second line)

if there are more than one sections like that (more than one kernel) i would recommend adding that to ALL of them

you must be root to edit the file, when you are done editing the file, simply save it and reboot

alternatively you can hit 'e' on the kernel entry at the grub menu to edit the entry, you may have to hold shift during the computer's POST to see the grub menu on modern distributions, add that at the end of the kernel line and then hit whatever button(s) it tells you at the bottom of the screen to boot the machine, this is a temporary way of adding it to the session to test whether or not it works before permanently committing it to the boot loader's configuration (that way if it doesn't work all you have to do is reboot to get rid of the option, if it works, THEN you add it to the configuration file)

Last edited by frieza; 07-18-2011 at 04:13 PM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Cannot allocate memory in reboot oracle linux alvinyeung Linux - Newbie 1 12-21-2007 10:43 AM
Linux won't boot; cannot allocate memory red13hat Linux - Newbie 2 08-30-2007 10:25 PM
How does linux allocate outbound ports ? genese Linux - Networking 2 12-21-2006 05:24 AM
Error inserting lockd: Cannot allocate memory - Linux 2.6.13.2 Iceberg69 Linux - Software 1 09-29-2005 11:20 PM
Unable to allocate Partition (XP & Linux) Monish Linux - Software 2 08-19-2003 05:23 AM


All times are GMT -5. The time now is 06:07 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration