Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Recently I've switched from ubuntu 32bit to 64bit version. And now I experiencing some problems.

All application take twice more memory. And some application takes even more. For example sshd on new server:

root      6608  0.0  0.0  67972  2912 ?        Ss   14:43   0:00 sshd: deploy [priv]
deploy    6616  0.0  0.0  67972  1724 ?        S    14:43   0:00 sshd: deploy@pts/4
root     20892  0.0  0.0  50916  1160 ?        Ss   15:53   0:00 /usr/sbin/sshd
root     21170  0.0  0.0  67972  2912 ?        Ss   15:56   0:00 sshd: deploy [priv]
deploy   21173  0.0  0.0  67972  1728 ?        S    15:56   0:00 sshd: deploy@pts/0
root     23802  0.0  0.0  67972  2912 ?        Ss   16:08   0:00 sshd: deploy [priv]
deploy   23804  0.0  0.0  67972  1724 ?        S    16:08   0:00 sshd: deploy@pts/1
root     24570  0.0  0.0  67972  2908 ?        Ss   12:45   0:00 sshd: deploy [priv]
deploy   24573  0.0  0.0  68112  1804 ?        S    12:45   0:00 sshd: deploy@pts/3
deploy   25014  0.0  0.0   5168   852 pts/0    S+   16:13   0:00 grep ssh

the same on the old server:

root      4867  0.0  0.0   5312  1028 ?        Ss   Mar23   0:00 /usr/sbin/sshd
root     23753  0.0  0.0   8052  2556 ?        Ss   16:15   0:00 sshd: deploy [priv]
deploy   23755  0.0  0.0   8052  1524 ?        S    16:15   0:00 sshd: deploy@pts/0
deploy   23770  0.0  0.0   3004   748 pts/0    D+   16:15   0:00 grep ssh

The same problems with postfix, nginx and some other application.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

It's a bit more complex than this.

Yes, the 64bit executables are going to consume more ram as some of the basic building-blocks of programs are larger on a 64bit system.

However, looking at the output you've provided it isn't all that bad. Unless there's actual contention for physical memory, the RSS (Resident Set Size, the part of a process which are in physical RAM) column is more appropriate, and looking at your output it's a lot less than a doubling of RAM consumption.

A more comprehensive discussion on memory usage can be found here: Understanding memory usage on linux

share|improve this answer
    
Does this issue has any relations with vm.overcommit_memory ? –  Valery Mar 29 '10 at 17:11
    
Thanks for the article. –  Valery Mar 29 '10 at 17:14
    
No, I don't believe this is related to vm.overcommit_memory. overcommit is giving the kernel room to allow malloc-requests even if it'd exceed available memory in the hope that it won't actually be used/needed, if you were to disable overcommit, you'd probably end up with applications exiting needlessly because of denied memory allocation-requests. –  Kjetil Joergensen Mar 30 '10 at 9:00
add comment

Welcome to 64 bits. Since default data types are twice the size, as are default instruction sizes, in-memory images will be consequently larger.

EDIT: A few (not SSH) programs are not well adapted to 64 bit systems. In one case a well-known UPS vendor's power monitoring daemon ballooned from an already large 400M to a huge 1.5G when run on a 64 bit Java runtime. Their response to the bug report was to tell me to run it on 32 bit Java. :)

share|improve this answer
    
So if I had 4Gb RAM on my old host with 32bit system, it's the same as new host with 64bit and 8Gb of RAM? So what's a point? –  Valery Mar 29 '10 at 14:17
    
In the end the point is twofold: first of all, you don't run x86_64 for nothing. Have a reason to do so, like have a lot of RAM: a i386 kernel doesn't support that by default. Second is that there are other pretty large downsides to running 8GiB on a i386 architecture, like having to map ZONE_HIGH in ZONE_NORMAL when using a lot of RAM. –  wzzrd Mar 29 '10 at 15:30
    
So in case of 8gb what would perform better. One 64bit instance or two 32bit instances with balancing? –  Valery Mar 29 '10 at 15:40
    
And one more thing. Why the difference is so big. I mean with the example with sshd. 8mb vs 67mb? –  Valery Mar 29 '10 at 15:41
    
No, its not that bad. First of all, only some processes are double in size, most see only a percentage gain. Secondly, as Kjetil pointed out, only the RSS portion is resident in memory, the rest of the program text is paged up off of the filesystem as needed. As a result most of the startup code pages gets discarded and no longer takes up any RAM. –  kmarsh Mar 30 '10 at 12:50
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.