LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-03-2008, 08:21 AM   #1
santana
Member
 
Registered: Sep 2004
Distribution: FC, ubuntu, OpenSuse
Posts: 112

Rep: Reputation: 16
4 gig Ram seen as 3 gig ubuntu


Hi, I am certain this has been asked some where else but the LQ search isn't allowing me to search with terms less than 4 characters long...

I just installed ubuntu gutsy 32 bit and I have 4 Gig ram, and he only sees 3 Gig. I understand that 32 bits can address 4 Gig, why does he not use the full 4 Gig? What can I do to fix? I want to fix in such a way that doesn't impede future apt updates.

Thanks
 
Old 04-03-2008, 10:25 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
4 Gig of address space is not enough for 4 Gig of ram because the BIOS must reserve some address space for PCI I/O and access to the memory inside the display adapter. Usually the BIOS reserves far more than those things ought to need so typically only 3.25 Gig of ram fits in 4 Gig of address space. You can see the details of the ram mapping near the begining of the dmesg output.

With the PAE CPU feature, a 32 bit kernel can use ram beyond 4 Gig of addressing.

But you would need to install a different kernel to make that work. I don't know how that would interact with future kernel updates from the ubuntu repository.

I think the 32 bit kernel (build-time) option to turn on PAE support is called "hugemem"

Last edited by johnsfine; 04-03-2008 at 10:28 AM.
 
Old 04-03-2008, 06:08 PM   #3
fragos
Senior Member
 
Registered: May 2004
Location: Fresno CA USA
Distribution: Ubuntu 10.10
Posts: 1,466

Rep: Reputation: 51
You didn't say but if you have an integrated mobo video that will reserve memory as well -- at least 64MB. To be honest, with a 1GB desktop system I almost never use any swap space. This would imply that more memory would little or no impact on performance.
 
Old 04-08-2008, 07:55 AM   #4
Methal
LQ Newbie
 
Registered: Apr 2008
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by fragos View Post
You didn't say but if you have an integrated mobo video that will reserve memory as well -- at least 64MB. To be honest, with a 1GB desktop system I almost never use any swap space. This would imply that more memory would little or no impact on performance.
Probably a completely ignorant question, but why do we see such a large performance boost in a windows machine with added memory past 1gig?
 
Old 04-08-2008, 08:08 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
If you're seeing 3 (plus) Gig, the kernel options are as required.
Different motherboards produce different numbers. 64-bit kernels avoid most of this issue.
 
Old 04-08-2008, 08:18 AM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by Methal View Post
why do we see such a large performance boost in a windows machine with added memory past 1gig?
In Linux or Windows, the amount that the swap file is used is not as accurate a measure of possible performance improvement from more memory as the many posts on this subject seem to indicate.

1) Depending on the programs you are running, a large fraction of your virtual memory might be backed by the original shared objects and executable images on disk rather than by the swap file.

The swap file is only used to swap out pages (4096 byte chunks) of memory that were created or modified by the running process. Pages that were read in from an executable or .so file and not modified are just discarded when the system is short of memory and read back in from their original source when needed again. That type of paging is half as expensive as paging with the swap space, but still significant for performance and reduced by having more memory.

2) Some programs do memory mapped I/O so there may be data (read only or read/write) paged directly to and from data files the same way item 1 described for read only executable image content. Again, the swap file wouldn't be touched even if low memory were causing significant extra disk accesses.

3) The file caching system in the OS effectively converts most disk I/O that the program does with non memory mapped functions into memory mapped functions using kernel memory. If the access pattern of your ordinary I/O is such that a large file cache improves performance, then that translates into a large performance boost from adding memory. Again, that is even if before adding memory there was no significant uses of swap space.

4) All the above are true of Linux and Windows. For Windows alone, there is the extra factor of rather large speculative use of swap space. Windows will use the swap file even when it doesn't really need to. Sometimes that makes system performance better, sometimes worse. But either way it creates the situation in which having more memory would make performance better.

Last edited by johnsfine; 04-08-2008 at 09:06 AM.
 
Old 04-08-2008, 09:03 AM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by syg00 View Post
If you're seeing 3 (plus) Gig, the kernel options are as required.
Could you explain that please.

Do you mean that seeing 3 plus Gig indicates the kernel already has hugemem? I don't think that is correct.

Do you mean that hugemem wouldn't let you see a larger fraction of the 4 gig of ram? I don't think that is correct either.

Maybe you mean the performance cost of hugemem (tlb misses will be a little slower) outweighs the performance benefits of having nearly 4 gig vs. about 3.25 gig. I don't think you meant that and I don't know how to estimate whether it would be true for any given system. Certainly not true for any system I use (where .7 gig of extra file caching would have significant performance impact).
 
Old 04-08-2008, 12:56 PM   #8
fragos
Senior Member
 
Registered: May 2004
Location: Fresno CA USA
Distribution: Ubuntu 10.10
Posts: 1,466

Rep: Reputation: 51
Quote:
Originally Posted by Methal View Post
Probably a completely ignorant question, but why do we see such a large performance boost in a windows machine with added memory past 1gig?
That's because it's not a Windows machine -- it's Ubuntu Linux. With Vista it would appear that 2GB is the minimum. More memory might further improve the performance of Linux but replacing access to swap space on disk with access to memory is a huge gain that is apparent to users without having to run benchmarks to see it.
 
Old 04-09-2008, 02:42 AM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by johnsfine View Post
Could you explain that please.

Do you mean that seeing 3 plus Gig indicates the kernel already has hugemem? I don't think that is correct.

Do you mean that hugemem wouldn't let you see a larger fraction of the 4 gig of ram? I don't think that is correct either.
I think the "HUGEMEM kernel" was a Redhat-ism. Never did know what it was specifically, but then I don't use RH, and I don't run 2.4 kernels.

For 32-bit 2.6 kernels, selecting CONFIG_HIGHMEM4G is sufficient to see the memory up to 4 Gig. CONFIG_HIGHMEM64G gets you addressing to the rest. Without either, you are limited to 1 Gig. (talking real memory addressing, not virtual). Linus has just recently sounded off (again) against people using HIGHMEM and large(-ish) memory. He seems to think it was a hack he would have preferred never happened.
Short answer, go 64-bit.
Large page (i.e. HUGETLB) is almost irrelevant in this discussion. For userland that mainly affects storage taken up in PTEs - for most (home) users that is minor unless they are something like an Oracle developer.
 
Old 04-09-2008, 08:19 AM   #10
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by syg00 View Post
I think the "HUGEMEM kernel" was a Redhat-ism.
I'm not at all sure of the naming of kernel build options, even in the distributions I use. I understand the meaning of the build option that turns on the CPU's PAE feature. I just am uncertain of its name.

Quote:
For 32-bit 2.6 kernels, selecting CONFIG_HIGHMEM4G is sufficient to see the memory up to 4 Gig.
Have you tried that yourself on a machine with 4 Gig of Ram? I'm sure you would find only about 3.25 Gig of Ram is usable.

Quote:
CONFIG_HIGHMEM64G gets you addressing to the rest.
So CONFIG_HIGHMEM64G is the name (at least at the point where you are looking at option names) of the PAE support and that option must be turned on to get access to the full 4 Gig on a system that has 4 Gig.

Quote:
talking real memory addressing, not virtual
So am I. But even in real memory addressing there is a level of mapping that puts about .75 Gig of the first 4 Gig of address space somewhere higher up. You can see all that in the memory list early in dmesg in any system with 4 Gig or more of ram.

Quote:
Short answer, go 64-bit.
I haven't seen any data from any systematic measurement of benefits/costs of 64-bit vs. 32-bit with PAE.

So maybe you're right. But I'm not ready to conclude that yet.

Quote:
Large page (i.e. HUGETLB) is almost irrelevant in this discussion.
Right. Did I miss that being mentioned somewhere earlier?

Quote:
For userland that mainly affects storage taken up in PTEs
You're missing the point of that feature. The 0.2% maximum possible memory savings from the PTEs wouldn't be interesting to anyone. Physical memory fragmentation issues and reduced VM flexibility from using that feature will cost more physical memory than the PTEs save anyway.

The point of that feature is the CPU time of the TLB misses. In some applications, the CPU time cost of TLB misses is the largest share of total CPU time. In some of those applications, using huge pages would dramatically increase performance.

TLB misses are a little slower in 32-bit with PAE than without. They are a little slower in 64-bit than in 32-bit with PAE. Usually those things don't matter because TLB misses usually aren't a significant share of total time.

When large pages are effective they eliminate most of the TLB misses. They also slightly speed up some of the TLB misses that they don't eliminate, but that aspect is not significant.

Last edited by johnsfine; 04-09-2008 at 08:21 AM.
 
  


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
I need 1 more gig RAM Hitboxx General 19 03-09-2007 03:48 AM
How to split a 9 Gig folder in 2x4.5 Gig folders jayhel Slackware 5 08-18-2005 11:36 PM
Mandrake 10 Support for 1 gig RAM and P4 w/ HT Tc2172 Linux - Newbie 5 05-28-2004 02:34 PM
Using Linux with more than 1 Gig of Ram Cenobyte Linux - General 8 04-05-2004 09:50 AM
Why my 80 gig hard drive only shows 70 gig? dsuratman Linux - Newbie 3 11-19-2003 11:54 PM

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

All times are GMT -5. The time now is 03:24 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