Current version

v1.10.4 (stable)


Main page
Archived news
Plugin SDK
Knowledge base
Contact info
Other projects


Blog Archive

An amusing benefit of staying in 32-bit land

Quick entry today.

A limitation of 32-bit code is that it lives in a 32-bit address space, which limits directly addressable memory to 2-4GB and typically usable memory to as low as 1.5GB. Well, I've found that this is sometimes a benefit. You see, a Core i7 CPU can run code really fast, and if you've got a piece of code stuck in a loop allocating memory, that means it can allocate memory really fast too -- so fast that it sends the system into swap death within seconds. Sometimes with a lightweight debugger like WinDbg/CDB or with command-line utilities like taskkill.exe you can nuke the process quickly, but with a heavyweight IDE like Visual Studio it can take minutes for the debugger for respond and for the system to recover. If you have enough system memory, however, the 32-bit process will run out of address space and crash out before it can do damage. It's funny to see a process instantly hit the 1.5GB brick wall in Task Manager and then break in the debugger.

(You might ask why I have a paging file at all. Well, certain features of Windows require a paging file because it's a convenient way to do critically low level I/O, such as writing a kernel dump file. It also increases the chances of you being able to catch the offender before the system really absolutely runs out of memory, at which time Bad Things Happen(tm).)


This blog was originally open for comments when this entry was first posted, but was later closed and then removed due to spam and after a migration away from the original blog software. Unfortunately, it would have been a lot of work to reformat the comments to republish them. The author thanks everyone who posted comments and added to the discussion.