LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Pre-allocating memory? (https://www.linuxquestions.org/questions/linux-newbie-8/pre-allocating-memory-702389/)

your_shadow03 02-04-2009 10:46 PM

Pre-allocating memory?
 
I have RHEL AS 4 Update 6 x86_64 Machine with 16 GB RAM running on one of the Blade Server.I want to pre-allocate 8GB Memory for performance testing.How Can I make it happen?

NOTE - physical removal of memory is no option).

Didier Spaier 02-05-2009 01:48 AM

Yes.

Quoted from /usr/src/linux-2.6.27-7/Documentation/kernel-parameters.txt:
Code:

        mem=nn[KMG]        [KNL,BOOT] Force usage of a specific amount of memory
                        Amount of memory to be used when the kernel is not able
                        to see the whole system memory or for test.
                        [X86-32] Use together with memmap= to avoid physical
                        address space collisions. Without memmap= PCI devices
                        could be placed at addresses belonging to unused RAM.

        mem=nopentium        [BUGS=X86-32] Disable usage of 4MB pages for kernel
                        memory.

        memmap=exactmap        [KNL,X86-32,X86_64] Enable setting of an exact
                        E820 memory map, as specified by the user.
                        Such memmap=exactmap lines can be constructed based on
                        BIOS output or other requirements. See the memmap=nn@ss
                        option description.

        memmap=nn[KMG]@ss[KMG]
                        [KNL] Force usage of a specific region of memory
                        Region of memory to be used, from ss to ss+nn.

        memmap=nn[KMG]#ss[KMG]
                        [KNL,ACPI] Mark specific memory as ACPI data.
                        Region of memory to be used, from ss to ss+nn.

        memmap=nn[KMG]$ss[KMG]
                        [KNL,ACPI] Mark specific memory as reserved.
                        Region of memory to be used, from ss to ss+nn.
                        Example: Exclude memory from 0x18690000-0x1869ffff
                                memmap=64K$0x18690000
                                or
                                memmap=0x10000$0x18690000


your_shadow03 02-05-2009 02:10 AM

Thats Really Informative Stuff..
I need some more help.How Can I set these kernel parameters anyway?

your_shadow03 02-05-2009 02:33 AM

Do I need to customize the kernel?
On which file I need to make the entry?

Didier Spaier 02-05-2009 02:58 AM

These are parameters you can give at time of booting.

To try one, write at time of booting:
<kernel_image_name> <kernel_parameter>=<value>

e.g. My only kernel image name for now is Linux (set up in lilo). So I could type at start up:
Linux mem=123456

Once you have found the good value(s) for your parameter(s) you can include it in an "append=" statement if yu use lilo. For grub I do not know, I do not use it.

your_shadow03 02-05-2009 03:06 AM

I am using GRUB and that too a Blade server. Do I need to reboot for GRUB to display or anything I can in runtime?
I will need to reboot the blade server?

Didier Spaier 02-05-2009 04:19 AM

Of course you have to reboot to set-up kernel parameters values at start up.

If you do not want to and you use the bash shell, you can instead setup limits at run-time, including for memory allocation, to processes launched by the shell.

To know the actual limits open a terminal or a console and type:
Code:

ulimit -a
So to set-up max memory size (value in kbytes):
Code:

ulimit -m <value>

msright1981 02-10-2009 11:35 AM

Nice tip, but why?
 
Hi,

May I ask why do u want to disable the extra memory in your blade without removing them, although you have to restart the server any way? just from curiosity.

your_shadow03 02-10-2009 10:10 PM

All I needed was to restrict the memory for particular process..Thats it...And I should allocate the rest for other process.
But I see no option to allocate remaining to other prcesses?
Do you have any?


All times are GMT -5. The time now is 08:55 PM.