»
S
I
D
E
B
A
R
«
Windows 32bit vs 64bit
Oct 14th, 2009 by evereq

if you have 64 bit version of Microsoft Windows (2008, 7 or 2003) it seems like it’s good idea to setup this version (instead of 32 bit) on both developer machine and production servers if you select .NET platform for your Web application and IIS as your hosting solution.

Here are some reasons why:
1) Serialization works much better on 64 bit OS in processes that hosted by IIS (at least for IIS 6,7,7.5). Means that if you want to serialize huge object (for example DataTable) in 32 bit OS you can get “Out Of memory” exception, while on 64 bit OS this works fine! As probably you know, IIS process on 32 bit OS can be practically maximum about 1200Mb size (while theoretically maximum is 2Gb for 32 bit OS) and for some scenarios this can be a not enough (for example if you going to use in-memory / in-process cache etc)
2) If you develop your system on 64 bit OS, you can be sure that it will work well on both 32 bit and 64 bit OS (at least you can check how it works). Usually problems start coming if you develop and test on 32 bit and than decide to host under 64 bit OS…. So why not to avoid this? Cost of both 32 bit and 64 bit OS usually is the same (at least for MS products), so if you don’t have some specific requirements (for example some of your library does not works under 64 bit machine) it looks like make sense to go with 64 bit!
3) In latest Server OS Windows 2008 R2, Microsoft removes 32 bit support and this version available only as 64 bit OS. That is why it looks like now make sense also to move to 64 bit on developer machine!

So, I found for myself following best software combination available today to develop / host .NET Web Application:

1) Developer Machine: Windows 7 Professional / Ultimate / Enterprise 64 bit with at least 8Gb PC memory (as you probably will want to run some virtual machines, your ReSharper will eat a log of memory in whole solution analyzing mode, Visual studio process can grow to 1Gb itself, Microsoft SQL Server same etc)

2) Hosting Server: Windows 2008 R2 (64 bit) with at least 4Gb memory even if you enable only IIS here (i.e. use server just as Web Server, but not as SQL Server etc), but use huge Sessions objects (not recommended, unless you already have stupid code that do so) or in memory (in process) huge Cache (ASP.NET or for example EntLib Cache etc).

Using such combination you will avoid a lot of problems with “Out of memory” related issues!

P.S. yes, yes, I know – instead of “Out of Memory” issue, you will get a lot of problems to make some soft working well under 64 bit (problems with Paths, dll versions etc). But time that you spend to fix all this setup issues, will save you much more time with Visual Studio (or other soft) crashes or when you go live with your application and get 100 times per day same “out of memory” in your logs! I don’t speak here about performance benefits here (if they exists at all) – it make sense to create special post for this!

P.P.S. sure thing, if you get such “out of memory” exceptions it is problems in your code (or in Microsoft code in some cases, like Visual Studio for example, but anyway it’s your fault! :D ) and you do something bad… In most cases you can change design and avoid such issues (split huge objects to smaller, don’t store in sessions or cache huge objects graphs, etc). In some cases you simply cannot change anything – it’s by requirements this way or you just have old stupid code that you need quickly to fix! In such cases, moving to 64 bit environment can be good temporary solution that will give you time to improve design / coding discipline! Just be worried – if you don’t change yourself – you will end up with same out of memory exceptions on 64 bit OS (store all 100Gb database as one huge serialized dataset in memory cache for example :) ha ha… I see something like this before really!)

»  Substance: WordPress   »  Style: Ahren Ahimsa
© Copyright 2008–2010 EvereQ.com All rights reserved. Logos, company names used here if any are only for reference purposes and they may be respective owners right or trademarks.