# should I enable highmem?

## sparks

I just bought another stick of 512 DDR to add to my system, which was already running with 512; total now 1024mb.  The first thing that came to mind was that I needed to enable highmem support in the kernel, but then I started reading around and stumbled on an article that states you actually take a performance hit when enabling highmem (by performance hit I guess he means responsiveness?...or latency?).  I actually read this from Con Kolivas' homepage (the kernel developer) and he recommended just sacrificing the last 100mb's or so because the performance hit would negate the increased memory size.  It is too bad that I could not find the article to link to, but it was interesting reading.  So,  in other peoples opinions is there really a "performance hit" when enabling highmem?

----------

## ectospasm

IIRC, highmem is only used >= 4GB, so at 1GB you should be OK.

----------

## sparks

From dmesg:

```
Warning only 896MB will be used.

Use a HIGHMEM enabled kernel.

896MB LOWMEM available.

```

Well, you can set different values.  If you do not enable highmem, you can use up to 896mb, but the next step up is to set a 4gb barrier, then you are able to use up to 4 gb.  There is an even higher setting for extremely large ammounts of RAM, for server use I guess.  But, to answer your question yes you do need highmem if you want to enable all 1024mb of memory in a one gig RAM system

----------

## terets

I read a similar article to what you read about this.

Basically, according to the author (I apologize for not recalling his name) if your kernel is compiled with HIGHMEM you run into a problem with the kernel having to reserve space for the kernel itself in memory.

He stated at 1024 MB you would not gain anything because the kernel will allocate the the gained RAM for addressing....or something like that...and additionaly, because of this, your performance will degrade.

I have the same ordeal, and I just use a lowmem kernel.  If you have a kernel developer saying not to do it, well, that kind of speaks highly.

----------

## dogshu

I use highmem on my machine with 1 GB of memory and it works fine, there are no performance problems with it that I know of.

I looked at Con Kolivas' homepage and I didn't see anything recommending turning off highmem support for 1GB systems... didn't turn up anything on google either... can you provide a link?

----------

## sparks

 *dogshu wrote:*   

> I use highmem on my machine with 1 GB of memory and it works fine, there are no performance problems with it that I know of.
> 
> I looked at Con Kolivas' homepage and I didn't see anything recommending turning off highmem support for 1GB systems... didn't turn up anything on google either... can you provide a link?

 

That's the reason my first post was so vague.  Con Kolivas' website is more of a blog of his new patchset instead of a static repertoire of kernel documentation.  I had originally read the article on highmem support almost  year ago which is obviously before I purchased my second stick of 512; and was wondering if what he stated was still valid with a modern 2.6 kernel.  I was also looking for some others users input on their take about highmem and what experiences they have had with it.  So, far I have not enabled it but on my next kernel upgrade which will probably be mm-2.6.2 I'll try highmem and see how it goes.

----------

## allucid

a problem that significant may have been resolved by now. Over 896MB of memory is not uncommon in desktops anymore.

----------

## dogshu

Just thought I'd let you guys know, Con Kolivas has said its OK to enable highmem for systems with 1 GB of RAM under 2.6, but not under 2.4.

http://kerneltrap.org/node/view/2450

Scroll down to the bottom to see Con Kolivas's comment:

 *Quote:*   

> I would recommend not using high mem support with 1Gb ram and sacrifice 128Mb unless you are running 2.6. If you are running 2.6 it is fine to enable high mem with 1Gb ram.

 

----------

## sparks

 *dogshu wrote:*   

> Just thought I'd let you guys know, Con Kolivas has said its OK to enable highmem for systems with 1 GB of RAM under 2.6, but not under 2.4.
> 
> http://kerneltrap.org/node/view/2450
> 
> Scroll down to the bottom to see Con Kolivas's comment:
> ...

 

Good reading thanks for the link.

----------

## helmers

But I still don't get it. Would it be okay if I did the 2G/2G split instead? Does someone know HOW much performance is lost?

And how does Windows (XP) manage this so well? The kernel seems like such a well thought-through project, there must be a reason it slows down Linux, but I have heard no such thing about Windows?   :Wink: 

----------

## brewt

If you're using a 2.4 kernel, with 1GB of memory, then the benefit of the extra memory is not more than the performance lost from the kernel having to manage that extra memory.  The code/data structures used in 2.4 were not particularly efficient, causing a slight performance hit when highmem was enabled.  With 2.6 kernels, this has been optimized, so it's not a problem anymore (ie. go ahead and turn on highmen).

For 2.4 kernels, one way around this performance hit is to get the patch which changes the split.  The downside to this is that your maximum process size is smaller, but this fortunately won't be a problem for most people.

----------

## radulucian

ok. i've read this thread before enabling highmem so i decided to do it.

unfortunately, in about 30 minutes my gentoo was already requesting swap (and i have 1 Gb of RAM), and NO PROCESSES where listed that would eat that amount of RAM.

i went back to a NON highmem enabled kernel and now my (heavy loaded) server is at 400Mb memory load.

i am running gentoo-dev-sources with kernel 2.6.4 and i have web, email, sql and some other smaller services.

so my answer is NO. DO NOT ENABLE HIGHMEM.

i will subscribe and follow this thread in case anyone requires some more details.

----------

## nmcsween

Ummm I have have Highmem enabled and right now with 20 tabs and mplayer and blender and gimp going my memory usage is 184 megs I highly doubt that Highmem is an evil thing.

----------

## radulucian

yeap. sorry for the previous post but i was kinda upset on the matter  :Smile: 

apparently there was no bug and no memory leak in the highmem enabled kernel, but rather the optimization that linux does in order to speed things up, and it was normal behaviour.

the extra memory used was probably used by the caching and buffers, so enabling highmem might be safe.

just thought i had to clarify this.

----------

## bombcar

If anyone wants dirty details they will have to learn the secrets of virtual memory.

Remember back in the old days of DOS? If you wanted to access memory above 1 MB, you had to "page" it into low memory. This is what things like EMM386 and what not did.

Well, 32 bits didn't prevent that problem, just moved it. And the kernel uses virtual addresses, but 2.4 only deals with 4 GB total of virtual memory. The default split is 1GB for real memory/ 3 GB for virtual addresses. Well, if you have more than 1GB (minus some room for device drivers, etc), then the real addresses overlap the virtual addresses.

So the kernel has to be able to page requests. Each paging request causes a memory copy, which is a performance hit. So for small amounts of memory, it just isn't worth it.

But you can make the split 2GB / 2GB, or enable the HIGHMEM directive (which does page).

So if you have gobs of RAM, highmem is still OK.

And the 64 bit processors will have a problem someday too, around 9223372036854775808 bytes of RAM.....  :Wink: 

----------

## F.Ultra

 *Quote:*   

> And how does Windows (XP) manage this so well?

 And how do you know that it does   :Shocked: . In fact XP has "highmem" enabled all the time so you wouldn't notice any performance changes since there was no way to test it with a "lomem" setting.

Reading stuff that kernel hackers write sometimes makes me feel that the Linux system is a very unstable and unfinished project but then I have to really pinch myself really hard and understand that the reason why I'm feeling like this is that the other OS:es like Microsofts does not have this openess so that is why I will never hear of such problems etc with them. So never assume that other OS:es do not have problems just because you have never heard of them!

----------

## PrakashP

I did this (http://www.uwsg.iu.edu/hypermail/linux/kernel/0402.1/1506.html) and it seems to work nicely w/o using highmem.

----------

## sparks

There is also now the 1gig_low_mem patch available in Con's CK patch set if anyone is still following this thread.

----------

## PrakashP

Yes, Con obviosly put above findings into that patch.  :Wink: 

----------

## TheCoop

ive got the patch myself if anyone wants it

----------

