LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-26-2010, 04:39 AM   #1
wagaboy
Member
 
Registered: Jun 2010
Distribution: Ubuntu 10.04, Cent OS 5.5, CLE3
Posts: 51

Rep: Reputation: 21
Physical and virtual memory upper limit for 32 bit Linux


Hi !

I have a 32 bit Ubuntu installed and my Laptop has 4GB RAM, but only 3GB is considered by Linux. My question is: what is the reason for the upper limit on physical memory ?

Code:
dmesg | grep Memory
[    0.000000] Memory: 3052428k/3112960k available (4673k kernel code, 56364k reserved, 2121k data, 656k init, 2200904k highmem)
I am familiar with the virtual memory concept where linux splits upper 1GB for kernel and lower 3GB for user processes. In total, linux 32bit can address 4GB virtual addresses. Does this meant that 1GB of physical memory is already mapped to 1GB of kernel space and Linux only shows the remaining 3GB physical memory left for the user in the above command.

I did some searching on the internet and found some articles related to this, but it only confused me further since some articles suggest 4GB is the upper limit with mentioning whether it's virtual or physical memory, some bring in the concept of PAE, etc. I'm relative new to Linux's memory management, so it'd be really helpful if someone could answer this.

Thanks in advance !
 
Old 06-26-2010, 04:43 AM   #2
pr_deltoid
Member
 
Registered: Jun 2010
Distribution: Fedora
Posts: 289

Rep: Reputation: 41
http://www.cyberciti.biz/faq/ubuntu-...tion-solution/
Quote:
Q. I've total 8 GB RAM installed in my dual boot Ubuntu Linux 8.10 (32 bit) version HP workstation. But free -m command only shows 3291 (3G) memory. How do I use 8GB RAM under Ubuntu Linux?

A. You need to install Physical Address Extension (PAE) aware kernel under 32 bit Ubuntu Linux. It is a feature of x86 and x86-64 processors that allows more than 4 Gigabytes of physical memory to be used in 32-bit systems.
It says that "free -m" shows only 3G memory, so apparently that is normal... and PAE would be for more than 4 GB.
Quote:
64 bit Linux kernel will take care of 4G or more memory. Just grab latest 64 bit version and install it.

Last edited by pr_deltoid; 06-26-2010 at 04:51 AM.
 
0 members found this post helpful.
Old 06-26-2010, 05:02 AM   #3
wagaboy
Member
 
Registered: Jun 2010
Distribution: Ubuntu 10.04, Cent OS 5.5, CLE3
Posts: 51

Original Poster
Rep: Reputation: 21
prdeltoid,
This is exactly the confusion that I was talking about in my earlier post. In the link that you sent, the original poster's system reports 3GB with 32 bit Linux, although he has 8GB RAM. The solution suggests installing 64 bit Linux or PAE for 4GB or more. If 4GB physical memory is all I have in my system, and I don't want anything more than this, why can't Linux report all 4GB or at least some value slightly less than 4GB. Why does it have to be 3.2 GB, which is about 800 MB short of 4GB

Last edited by wagaboy; 06-26-2010 at 05:06 AM.
 
Old 06-26-2010, 05:15 AM   #4
pr_deltoid
Member
 
Registered: Jun 2010
Distribution: Fedora
Posts: 289

Rep: Reputation: 41
Right, "4GB or more". It's not saying to use 64-bit Linux for more than 4GB, it's saying to use 64-bit for 4GB or more. It's saying to use PAE for 4GB or more. All the things I just saw googling were people saying that they have 4GB RAM and about 3.2GB is used. But if you use 64-bit Linux you'll be using all 4GB. Or PAE.
EDIT: I have no idea why it's like that. I read that Windows uses 4GB and to use more you have to use the newer 64-bit versions... then I looked more closely and Windows has the same issue. There's a lot of explanation here:
http://www.codinghorror.com/blog/200...es-of-ram.html

Quote:
To be perfectly clear, this isn't a Windows problem-- it's an x86 hardware problem. The memory hole is quite literally invisible to the CPU, no matter what 32-bit operating system you choose.

Last edited by pr_deltoid; 06-26-2010 at 05:41 AM.
 
Old 06-26-2010, 06:36 AM   #5
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 wagaboy View Post
This is exactly the confusion that I was talking about in my earlier post.
What is confusing? Everything you mentioned seems to say the same thing. For 4GB or more you need either PAE or 64 bit. You just seem to have trouble believing it.

Quote:
If 4GB physical memory is all I have in my system, and I don't want anything more than this, why can't Linux report all 4GB or at least some value slightly less than 4GB. Why does it have to be 3.2 GB, which is about 800 MB short of 4GB
The amount less than 4GB is controlled by the motherboard and the BIOS. Linux has no way to influence that. Some systems let you use 3.5GB some restrict you to even less than 3GB.

If typical motherboards permitted you to use almost the whole 4GB, the advice to use PAE for 4GB or more wouldn't be as appropriate. Lots of people have exactly 4GB of ram and if they could use almost all of it without PAE, we would be advising them to do so. We advise people with exactly 4GB to use PAE or 64 bit because motherboard designs reserve a significant chunk of the first 4GB of physical address space.

Notice the motherboard and BIOS and often some BIOS menu options control whether even 64bit or PAE can use more ram. On some motherboards 64bit and PAE are both restricted to the same limit (significantly less than 4GB) that non PAE 32 bit can use. On many motherboards, there is a BIOS option that must be set to allow 64bit or PAE to use more.

Many of my previous posts on this topic tell you how to check, even while you are still running a 32 bit non PAE kernel, whether your BIOS is set to allow PAE and 64bit to use more ram.

Last edited by johnsfine; 06-26-2010 at 06:42 AM.
 
  


Reply



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
How to access physical (as opposed to virtual) memory in C language for a Linux app. ss729 Programming 2 12-23-2008 03:02 PM
64-bit Linux virtual memory limit? wmnwmn Linux - General 1 02-01-2008 10:43 AM
how can i run 3 linux virtual machines without going out of physical memory asterik123 General 7 04-14-2007 05:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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