LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Patch kernel: I have 8 Gbytes RAM, but why I can only allocate 2.8 Gbytes RAM for a single process?
@ 2008-02-25  7:44 Ady Wicaksono
  2008-02-25  8:58 ` Rene Herman
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ady Wicaksono @ 2008-02-25  7:44 UTC (permalink / raw)
  To: linux-kernel

I have 8 Gbytes RAM, but why I can allocate 2.8 Gbytes RAM for a single process?
How to patch kernel so I have more than 2.8 Gbytes limitation?

Kernel:
---------------------------
Linux xxx.com 2.6.9-023stab046.2-enterprise #1 SMP Mon Dec 10 15:22:33
MSK 2007 i686 i686 i386 GNU/Linux

Mem:
---------------------------
# cat /proc/meminfo
MemTotal:      8296484 kB
MemFree:         50416 kB
Buffers:         64412 kB
Cached:        4927328 kB
SwapCached:          0 kB
Active:        6710828 kB
Inactive:      1065384 kB
HighTotal:     4980736 kB
HighFree:         1024 kB
LowTotal:      3315748 kB
LowFree:         49392 kB
SwapTotal:    10256376 kB
SwapFree:     10255732 kB
Dirty:              64 kB
Writeback:           0 kB
Mapped:        3054960 kB
Slab:           393224 kB
CommitLimit:  14404616 kB
Committed_AS:  6318152 kB
PageTables:      34892 kB
VmallocTotal:   303096 kB
VmallocUsed:     22360 kB
VmallocChunk:   280496 kB


CPU (8 processor id from 0-7), one of them is:
---------------------------
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 6
model name      : Intel(R) Xeon(TM) CPU 3.00GHz
stepping        : 4
cpu MHz         : 2993.054
cache size      : 2048 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx
lm constant_tsc pni monitor ds_cpl est cid xtpr
bogomips        : 5989.55

App to test memory limit:
---------------------------
#include <stdio.h>
#include <stdlib.h>

int main(){
        size_t siz = 100 * 1024 * 1024 ;
        size_t idx = 1 ;
        void *ptr;

        for (;;){
                ptr = malloc ( siz * idx );
                if(!ptr)
                        break ;
                free(ptr);
                idx++;
        }
        printf ("Max malloc %d * 100 MB \n", idx - 1 );
        return (0);
}

App result: Max malloc 28 * 100 MB ==> 2.8 Gbytes


-- 
Regards,

Ady Wicaksono
Email:
ady.wicaksono at gmail.com
http://adywicaksono.wordpress.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Patch kernel: I have 8 Gbytes RAM, but why I can only allocate 2.8 Gbytes RAM for a single process?
  2008-02-25  7:44 Patch kernel: I have 8 Gbytes RAM, but why I can only allocate 2.8 Gbytes RAM for a single process? Ady Wicaksono
@ 2008-02-25  8:58 ` Rene Herman
  2008-02-25 17:22 ` J.C. Pizarro
  2008-02-25 20:56 ` Masoud Sharbiani "مسعود شربیانی"
  2 siblings, 0 replies; 5+ messages in thread
From: Rene Herman @ 2008-02-25  8:58 UTC (permalink / raw)
  To: Ady Wicaksono; +Cc: linux-kernel

On 25-02-08 08:44, Ady Wicaksono wrote:

> I have 8 Gbytes RAM, but why I can allocate 2.8 Gbytes RAM for a single
> process? How to patch kernel so I have more than 2.8 Gbytes limitation?

[ ... ]

> flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
> mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx
> lm constant_tsc pni monitor ds_cpl est cid xtpr

Run a 64-bit kernel and userspace. not a 32-bit.

Rene.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Patch kernel: I have 8 Gbytes RAM, but why I can only allocate 2.8 Gbytes RAM for a single process?
  2008-02-25  7:44 Patch kernel: I have 8 Gbytes RAM, but why I can only allocate 2.8 Gbytes RAM for a single process? Ady Wicaksono
  2008-02-25  8:58 ` Rene Herman
@ 2008-02-25 17:22 ` J.C. Pizarro
  2008-02-25 20:31   ` Arnd Hannemann
  2008-02-25 20:56 ` Masoud Sharbiani "مسعود شربیانی"
  2 siblings, 1 reply; 5+ messages in thread
From: J.C. Pizarro @ 2008-02-25 17:22 UTC (permalink / raw)
  To: Ady Wicaksono, LKML

2008/2/25, Ady Wicaksono <ady.wicaksono@gmail.com>:
> I have 8 Gbytes RAM, but why I can allocate 2.8 Gbytes RAM for a single process?
>  How to patch kernel so I have more than 2.8 Gbytes limitation?
>
>  Kernel:
>  ---------------------------
>  Linux xxx.com 2.6.9-023stab046.2-enterprise #1 SMP Mon Dec 10 15:22:33
>  MSK 2007 i686 i686 i386 GNU/Linux
>
>  Mem:
>  ---------------------------
>  # cat /proc/meminfo
>  MemTotal:      8296484 kB
>  MemFree:         50416 kB
>  Buffers:         64412 kB
>  Cached:        4927328 kB
>  SwapCached:          0 kB
>  Active:        6710828 kB
>  Inactive:      1065384 kB
>  HighTotal:     4980736 kB
>  HighFree:         1024 kB
>  LowTotal:      3315748 kB
>  LowFree:         49392 kB
>  SwapTotal:    10256376 kB
>  SwapFree:     10255732 kB
>  Dirty:              64 kB
>  Writeback:           0 kB
>  Mapped:        3054960 kB
>  Slab:           393224 kB
>  CommitLimit:  14404616 kB
>  Committed_AS:  6318152 kB
>  PageTables:      34892 kB
>  VmallocTotal:   303096 kB
>  VmallocUsed:     22360 kB
>  VmallocChunk:   280496 kB
>
>
>  CPU (8 processor id from 0-7), one of them is:
>  ---------------------------
>  processor       : 0
>  vendor_id       : GenuineIntel
>  cpu family      : 15
>  model           : 6
>  model name      : Intel(R) Xeon(TM) CPU 3.00GHz
>  stepping        : 4
>  cpu MHz         : 2993.054
>  cache size      : 2048 KB
>  physical id     : 0
>  siblings        : 4
>  core id         : 0
>  cpu cores       : 2
>  fdiv_bug        : no
>  hlt_bug         : no
>  f00f_bug        : no
>  coma_bug        : no
>  fpu             : yes
>  fpu_exception   : yes
>  cpuid level     : 6
>  wp              : yes
>  flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
>  mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx
>  lm constant_tsc pni monitor ds_cpl est cid xtpr
>  bogomips        : 5989.55
>
>  App to test memory limit:
>  ---------------------------
>  #include <stdio.h>
>  #include <stdlib.h>
>
>  int main(){
>         size_t siz = 100 * 1024 * 1024 ;
>         size_t idx = 1 ;
>         void *ptr;
>
>         for (;;){
>                 ptr = malloc ( siz * idx );
>                 if(!ptr)
>                         break ;
>                 free(ptr);
>                 idx++;
>         }
>         printf ("Max malloc %d * 100 MB \n", idx - 1 );
>         return (0);
>  }
>
>  App result: Max malloc 28 * 100 MB ==> 2.8 Gbytes

1. It's a 32-bit processor Xeon with 8 GiB of RAM. OK?
2. The 32-bit userspace's process is always limited to <3.0 GiB ( < 0xC0000000 )
3. Enable PAE (64 GB option in the kernel) to address the 8 GiB of RAM
using PAE,
    also you can have many processes of ~3 GiB per process.
    I'm not sure if the PAE's three-level paging works efficient in linux.

   ;)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Patch kernel: I have 8 Gbytes RAM, but why I can only allocate 2.8 Gbytes RAM for a single process?
  2008-02-25 17:22 ` J.C. Pizarro
@ 2008-02-25 20:31   ` Arnd Hannemann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Hannemann @ 2008-02-25 20:31 UTC (permalink / raw)
  To: J.C. Pizarro; +Cc: Ady Wicaksono, LKML

J.C. Pizarro schrieb:
> 2008/2/25, Ady Wicaksono <ady.wicaksono@gmail.com>:
>> I have 8 Gbytes RAM, but why I can allocate 2.8 Gbytes RAM for a single process?
>>  How to patch kernel so I have more than 2.8 Gbytes limitation?
>>
>>  Kernel:
>>  ---------------------------
>>  Linux xxx.com 2.6.9-023stab046.2-enterprise #1 SMP Mon Dec 10 15:22:33
>>  MSK 2007 i686 i686 i386 GNU/Linux
>>
>>  Mem:
>>  ---------------------------
>>  # cat /proc/meminfo
>>  MemTotal:      8296484 kB
>>  MemFree:         50416 kB
>>  Buffers:         64412 kB
>>  Cached:        4927328 kB
>>  SwapCached:          0 kB
>>  Active:        6710828 kB
>>  Inactive:      1065384 kB
>>  HighTotal:     4980736 kB
>>  HighFree:         1024 kB
>>  LowTotal:      3315748 kB
>>  LowFree:         49392 kB
>>  SwapTotal:    10256376 kB
>>  SwapFree:     10255732 kB
>>  Dirty:              64 kB
>>  Writeback:           0 kB
>>  Mapped:        3054960 kB
>>  Slab:           393224 kB
>>  CommitLimit:  14404616 kB
>>  Committed_AS:  6318152 kB
>>  PageTables:      34892 kB
>>  VmallocTotal:   303096 kB
>>  VmallocUsed:     22360 kB
>>  VmallocChunk:   280496 kB
>>
>>
>>  CPU (8 processor id from 0-7), one of them is:
>>  ---------------------------
>>  processor       : 0
>>  vendor_id       : GenuineIntel
>>  cpu family      : 15
>>  model           : 6
>>  model name      : Intel(R) Xeon(TM) CPU 3.00GHz
>>  stepping        : 4
>>  cpu MHz         : 2993.054
>>  cache size      : 2048 KB
>>  physical id     : 0
>>  siblings        : 4
>>  core id         : 0
>>  cpu cores       : 2
>>  fdiv_bug        : no
>>  hlt_bug         : no
>>  f00f_bug        : no
>>  coma_bug        : no
>>  fpu             : yes
>>  fpu_exception   : yes
>>  cpuid level     : 6
>>  wp              : yes
>>  flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
>>  mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx
>>  lm constant_tsc pni monitor ds_cpl est cid xtpr
>>  bogomips        : 5989.55
>>
>>  App to test memory limit:
>>  ---------------------------
>>  #include <stdio.h>
>>  #include <stdlib.h>
>>
>>  int main(){
>>         size_t siz = 100 * 1024 * 1024 ;
>>         size_t idx = 1 ;
>>         void *ptr;
>>
>>         for (;;){
>>                 ptr = malloc ( siz * idx );
>>                 if(!ptr)
>>                         break ;
>>                 free(ptr);
>>                 idx++;
>>         }
>>         printf ("Max malloc %d * 100 MB \n", idx - 1 );
>>         return (0);
>>  }
>>
>>  App result: Max malloc 28 * 100 MB ==> 2.8 Gbytes
> 
> 1. It's a 32-bit processor Xeon with 8 GiB of RAM. OK?
No, its not. cpuinfo indicates that it understands 64 bit (X86_FEATURE_LM)

> 2. The 32-bit userspace's process is always limited to <3.0 GiB ( < 0xC0000000 )
Yep thats right.

> 3. Enable PAE (64 GB option in the kernel) to address the 8 GiB of RAM
> using PAE,
He did already enable it as indicated by /proc/meminfo...

>     also you can have many processes of ~3 GiB per process.
>     I'm not sure if the PAE's three-level paging works efficient in linux.
> 
>    ;)

I'm not sure either.

Best regard,
Arnd


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Patch kernel: I have 8 Gbytes RAM, but why I can only allocate 2.8 Gbytes RAM for a single process?
  2008-02-25  7:44 Patch kernel: I have 8 Gbytes RAM, but why I can only allocate 2.8 Gbytes RAM for a single process? Ady Wicaksono
  2008-02-25  8:58 ` Rene Herman
  2008-02-25 17:22 ` J.C. Pizarro
@ 2008-02-25 20:56 ` Masoud Sharbiani "مسعود شربیانی"
  2 siblings, 0 replies; 5+ messages in thread
From: Masoud Sharbiani "مسعود شربیانی" @ 2008-02-25 20:56 UTC (permalink / raw)
  To: Ady Wicaksono; +Cc: linux-kernel

On 2/24/08, Ady Wicaksono <ady.wicaksono@gmail.com> wrote:
> I have 8 Gbytes RAM, but why I can allocate 2.8 Gbytes RAM for a single process?
>  How to patch kernel so I have more than 2.8 Gbytes limitation?
>
>  Kernel:
>  ---------------------------
>  Linux xxx.com 2.6.9-023stab046.2-enterprise #1 SMP Mon Dec 10 15:22:33
>  MSK 2007 i686 i686 i386 GNU/Linux

You really need to use 64 bit kernel AND 64 bit userspace to use more
than 3gigs per process.

Masoud

>  Mem:
>  ---------------------------
>  # cat /proc/meminfo
>  MemTotal:      8296484 kB
>  MemFree:         50416 kB
>  Buffers:         64412 kB
>  Cached:        4927328 kB
>  SwapCached:          0 kB
>  Active:        6710828 kB
>  Inactive:      1065384 kB
>  HighTotal:     4980736 kB
>  HighFree:         1024 kB
>  LowTotal:      3315748 kB
>  LowFree:         49392 kB
>  SwapTotal:    10256376 kB
>  SwapFree:     10255732 kB
>  Dirty:              64 kB
>  Writeback:           0 kB
>  Mapped:        3054960 kB
>  Slab:           393224 kB
>  CommitLimit:  14404616 kB
>  Committed_AS:  6318152 kB
>  PageTables:      34892 kB
>  VmallocTotal:   303096 kB
>  VmallocUsed:     22360 kB
>  VmallocChunk:   280496 kB
>
>
>  CPU (8 processor id from 0-7), one of them is:
>  ---------------------------
>  processor       : 0
>  vendor_id       : GenuineIntel
>  cpu family      : 15
>  model           : 6
>  model name      : Intel(R) Xeon(TM) CPU 3.00GHz
>  stepping        : 4
>  cpu MHz         : 2993.054
>  cache size      : 2048 KB
>  physical id     : 0
>  siblings        : 4
>  core id         : 0
>  cpu cores       : 2
>  fdiv_bug        : no
>  hlt_bug         : no
>  f00f_bug        : no
>  coma_bug        : no
>  fpu             : yes
>  fpu_exception   : yes
>  cpuid level     : 6
>  wp              : yes
>  flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
>  mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx
>  lm constant_tsc pni monitor ds_cpl est cid xtpr
>  bogomips        : 5989.55
>
>  App to test memory limit:
>  ---------------------------
>  #include <stdio.h>
>  #include <stdlib.h>
>
>  int main(){
>         size_t siz = 100 * 1024 * 1024 ;
>         size_t idx = 1 ;
>         void *ptr;
>
>         for (;;){
>                 ptr = malloc ( siz * idx );
>                 if(!ptr)
>                         break ;
>                 free(ptr);
>                 idx++;
>         }
>         printf ("Max malloc %d * 100 MB \n", idx - 1 );
>         return (0);
>  }
>
>  App result: Max malloc 28 * 100 MB ==> 2.8 Gbytes
>
>
>  --
>  Regards,
>
>  Ady Wicaksono
>  Email:
>  ady.wicaksono at gmail.com
>  http://adywicaksono.wordpress.com/
>
> --
>  To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>  the body of a message to majordomo@vger.kernel.org
>  More majordomo info at  http://vger.kernel.org/majordomo-info.html
>  Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-02-25 20:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-25  7:44 Patch kernel: I have 8 Gbytes RAM, but why I can only allocate 2.8 Gbytes RAM for a single process? Ady Wicaksono
2008-02-25  8:58 ` Rene Herman
2008-02-25 17:22 ` J.C. Pizarro
2008-02-25 20:31   ` Arnd Hannemann
2008-02-25 20:56 ` Masoud Sharbiani "مسعود شربیانی"

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).