Page 1 of 7 123 ... LastLast
Results 1 to 10 of 62

Thread: 32 bit Ubuntu with 4GB+ of memory

  1. #1
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    32 bit Ubuntu with 4GB+ of memory

    Overview

    This guide is to explain how Ubuntu handles 4 or more gigabytes of memory and the options you have for utilizing all your memory.

    By default, the 32bit versions of Ubuntu support up to 4GB of memory however, in practice, if you have 4GB of memory, you will generally only see somewhere between 3GB and 3.5GB. The reason for this is that various devices on your computer need large chunks of the memory address space to work properly and so the system maps them into the highest parts of memory. When that happens on a machine with 4GB of memory and a 32bit kernel, it limits the amount addressable physical memory.

    The options you have for running Ubuntu with 4G+ of memory are:

    1) Use a 64bit version of Ubuntu
    If your machine supports it, the easiest way to make use of 4GB+ of memory on Ubuntu is to simply use a 64bit version of Ubuntu which can inherently handle large amounts of memory. For some motherboards, you may have to enable a feature called "Map around memory hole" in the BIOS for this to work (it may be called something different depending on the BIOS however, it should be named something similar to this).

    Pros:
    - Requires no extra setup
    - No inherent performance hit for using 4GB+ of RAM

    Cons:
    - Not supported on all hardware
    - Not all software/drivers may be supported for 64bit versions of Ubuntu. However, this is far less of an issue than it used to be and most users will have no problems whatsoever running 64bit.

    2) Use a PAE enabled kernel
    PAE is a way to allow a 32bit kernel to address up to 36bits of memory (64GB). The kernel documentation says that there is a slight performance hit when using PAE however, in practice, you are not likely to notice any difference in performance. The default Ubuntu kernel does not have PAE enabled however, there are two ways to get a PAE enabled kernel:

    2.1) Ubuntu server kernel
    The Ubuntu server kernel has PAE enabled and can be installed by doing:

    Code:
    sudo apt-get install linux-server linux-headers-server linux-restricted-modules-server
    After the server kernel has been installed, you can select it from the grub boot menu.

    Pros:
    - Easy to setup and maintain on an existing 32bit install
    - Works on machines that cannot use a 64bit version of Ubuntu but support 4GB+ of RAM.

    Cons:
    - The server kernel is not optimized for desktop usage (see link above). However, depending on how you use your machine you may not notice any difference.
    - There can be issues with third party drivers and the server kernel (specifically, nvidia drivers).

    2.2) Build a PAE enabled kernel
    It's very easy to enable PAE in a custom compiled kernel. From "make menuconfig", the option to enable it is:

    Code:
    -> Processor type and features
      -> High Memory Support
        -> 64GB
    There are many guides to building a kernel for an Ubuntu machine:
    - http://ubuntuforums.org/showthread.php?t=311158
    - http://www.howtoforge.com/kernel_compilation_ubuntu
    - http://ubuntuforums.org/showthread.php?t=618563
    - https://help.ubuntu.com/community/Kernel/Compile (from Ubuntu source)

    Pros:
    - Better desktop performance than the Ubuntu server kernel
    - Building a custom kernel helps you learn about the system

    Cons:
    - Building a custom kernel can be difficult and time consuming.
    - You may have to manually install some drivers for your hardware.
    - By not using an Ubuntu kernel, you become responsible for keeping your kernel up to date with security patches.

    3) Do nothing
    If your machine is not capable of running a 64bit version of Ubuntu, the performance of the server kernel isn't to your liking and you aren't willing to build a custom kernel, your last option is to simply do nothing. This will limit you to around 3GB to 3.5GB of memory however, it shouldn't cause any system instability or problems.

    Comments/questions/suggestions welcome.
    Last edited by sdennie; July 28th, 2008 at 03:54 AM. Reason: Fix typos
    Don't try to make something "fast" until you are able to quantify "slow".

  2. #2
    Join Date
    Jul 2005
    Location
    FRANCE
    Beans
    162
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: 32 bit Ubuntu with 4GB+ of memory

    Thanks man !

  3. #3
    Join Date
    Oct 2006
    Location
    Belgrade, Serbia
    Beans
    1,325
    Distro
    Ubuntu

    Re: 32 bit Ubuntu with 4GB+ of memory

    this is a keeper great information!
    It would be good to add a link to the memory limitations to 64-bit Ubuntu too:
    http://en.wikipedia.org/wiki/64-bit#Memory_limitations
    Last edited by forger; July 11th, 2008 at 03:03 PM.

  4. #4
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: 32 bit Ubuntu with 4GB+ of memory

    Quote Originally Posted by forger View Post
    this is a keeper great information!
    It would be good to add a link to the memory limitations to 64-bit Ubuntu too:
    http://en.wikipedia.org/wiki/64-bit#Memory_limitations
    Updated the 64bit section with this link.
    Don't try to make something "fast" until you are able to quantify "slow".

  5. #5
    Join Date
    Jun 2006
    Beans
    Hidden!

    Thumbs up Re: 32 bit Ubuntu with 4GB+ of memory

    Went with the 2.1 option - server kernel - works like a *charm* - maybe even better than the desktop one.
    Thanks! (EDIT: nope, problems with compiz (the eye candy))

    (had to do 'apt-get update' cos dependencies were b0rken)

    Default 32-bit Ubuntu should really have PAE enabled - 64-bit version really makes sense only in a very few cases, actually in only one case: when you need to run a *single* application that needs more than 3 GB memory.
    The catch is, that 64-bit applications also take more memory than 32-bit apps with the same data/code set (in the case of Java it's two times more - means 1gb 32bit app == 2gb 64bit app), so you may need to start with 8 GB ram for the 32 to 64 bit upgrade to make any sense.
    Last edited by yct; July 25th, 2008 at 11:06 PM. Reason: foud problems later

  6. #6
    Join Date
    Apr 2006
    Beans
    14

    Re: 32 bit Ubuntu with 4GB+ of memory

    Well im getting a new computer soon (tossing stationary+laptop for ûber laptop) and thinking about getting 6-8GB of ram (I wanto run 1-2 OS's in VMWARE from time to time, for experimental purposes.).
    Now, I dont wanto sit there without security patches and whatnot.. is there any new version of ubuntu around the corner (say 3-4 months?) that will support this?
    Shouldnt be so hard, if we can just build it in ourself, and they even have it enabled by default in server-version?

  7. #7
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: 32 bit Ubuntu with 4GB+ of memory

    Quote Originally Posted by gurkburk View Post
    Well im getting a new computer soon (tossing stationary+laptop for ûber laptop) and thinking about getting 6-8GB of ram (I wanto run 1-2 OS's in VMWARE from time to time, for experimental purposes.).
    Now, I dont wanto sit there without security patches and whatnot.. is there any new version of ubuntu around the corner (say 3-4 months?) that will support this?
    Shouldnt be so hard, if we can just build it in ourself, and they even have it enabled by default in server-version?
    The -generic kernel in Intrepid doesn't have PAE enabled and I haven't seen any new kernel types added so, no, I don't think there are any plans to have a desktop tuned PAE kernel for the near future. Depending on how you use the machine, the -server kernel might work just fine for you though.
    Don't try to make something "fast" until you are able to quantify "slow".

  8. #8
    Join Date
    Jun 2006
    Beans
    Hidden!

    Re: 32 bit Ubuntu with 4GB+ of memory

    I've edited my post above, because later in the day Compiz had crashed on me.
    However right after the edit, I did notice that I'm now actuallly running on the server kernel again (as it's the default in my grub), and I'm still fine. Besides the server kernel, I've also installed Vmware Server, so that might've been the problem too.
    I will let you know if I'll be having more probs with server kernel on the desktop.

  9. #9
    Join Date
    Jul 2007
    Location
    Austin, TX (formerly D.C)
    Beans
    359
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: 32 bit Ubuntu with 4GB+ of memory

    First off, thanks for a great tutorial!

    One comment...

    - By not using an Ubuntu kernel, you become responsible for keeping your kernel up to date with security patches.
    I believe you can get (and modify) the kernel source with Ubuntu patches through apt. For example:

    Code:
    sudo aptitude install linux-source-2.6.26
    Will get the patched code and place it in /usr/src/. You can then modify this kernel to enable PAE in order to get 4+ GB of memory support.

    Mike

  10. #10
    Join Date
    Jan 2007
    Location
    $here ? $here : $there
    Beans
    3,717
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: 32 bit Ubuntu with 4GB+ of memory

    Quote Originally Posted by mbsullivan View Post
    First off, thanks for a great tutorial!

    One comment...



    I believe you can get (and modify) the kernel source with Ubuntu patches through apt. For example:

    Code:
    sudo aptitude install linux-source-2.6.26
    Will get the patched code and place it in /usr/src/. You can then modify this kernel to enable PAE in order to get 4+ GB of memory support.

    Mike
    Yes, you can use the Ubuntu source to build a PAE kernel. However, it's still not completely automatic in that when the kernel source changes it will still be up to the user to rebuild the new kernel source. I'll update the first post with a link to point to a tutorial on how to build a kernel from the Ubuntu source.
    Don't try to make something "fast" until you are able to quantify "slow".

Page 1 of 7 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •