As some people have already noted, Windows cannot and does not provide all 4GB of memory address space to an application. Each application is *only* assured 2GB of contiguous memory space by the 32-bit Windows kernel. Further memory allocations must fit into the artificial boundaries that the kernel has imposed on the memory space. So, if you write an application that allocates a 3GB block all at once it will fail immediately. It is not uncommon at all to see a normal application fail at around 2.2GB or so working set size.
For those of you who like pictures, this is roughly what's happening, X's are space that the OS has reserved for itself, as the application grows it has to fit any new memory allocations into smaller and smaller spaces:
0GB 2GB 4GB
|<---Application Memory -->|X| |XX| |X| |XX| |
Check your pagefile settings, make sure they are set to a reasonable value: 1.5x your physical memory should be right for a standard machine. If you like to live life on the edge, you can always enable the /3GB switch in your boot.ini. I do not recommend doing so as it does not play very nice with your average application/driver.
You could also upgrade to a 64-bit OS. All this said, think deeply about whether you really want or need the extra memory. Windows 64-bit versions are still young and have plenty of bugs, driver support issues, and general annoyances to make your life hell.