LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to allocate maxmem in Linux? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-allocate-maxmem-in-linux-891891/)

pawoseyi 07-15-2011 10:22 AM

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...

MensaWater 07-15-2011 12:45 PM

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.

syg00 07-15-2011 06:57 PM

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]

pawoseyi 07-17-2011 04:06 PM

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...:-)

syg00 07-17-2011 05:56 PM

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.

pawoseyi 07-18-2011 12:59 PM

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...

frieza 07-18-2011 03:11 PM

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)


All times are GMT -5. The time now is 02:31 AM.