Win XP comes in 32bit and 64bit versions. If your version is a 32bit version then the most memory that XP can use is just over 3GB (I think it's about 3.1 or 3.2). If your version of XP is a 64bit version then it'll be able to use the full 4GB of memory
Windows XP will allow up to around 8GB of RAM if you have a 64bit edition.
But alike Vista and Windows 7, the memory allocation table in 32bit OS's cannot handle more than 3GB. If you do put the full 4GB into the 32bit OS, only 3GB will be visible and usable on the machine and the other 1GB will be allocated to background caching and video RAM (as it cannot be directly assigned to the OS).
What I would say is... if you are thinking of going to a 64bit OS, do not under any circumstances go to XP 64bit. The majority of the processes are still in 32bit and the entire OS was hacked together to make it compatible at the most basic level for the 64bit subsystem. If you want to have a full 4GB and actually use it, you REALLY should be using Windows 7. Not only will the 64bit version allow you to use that full 4GB (rather than giving you partial access to it), the OS is MUCH more optimized than XP, especially in allocating larger subsets of RAM and you are likely going to find the OS perform much better.
...the memory allocation table in 32bit OS's cannot handle more than 3GB.
Not entirely true. The OS can handle the full 32 Address space (4 GB RAM) the reason why it doesn't add up to 4 GB is because the hardware needs to have references in the same address space. Adding 4 GBs into a 32 bit system fills the address space up to its limits. But it has to truncate addressable memory so it can give addresses to other hardware components like the graphics card. That is why on a 32 bit system you do not get the full 4 GB of RAM, there is not enough room in the hardware's (CPU's) address space.
Just to clarify, the addressing space is shared between RAM and hardware components. On a 64bit system this same limitation exists. However, the addressing space in much much larger. Currently 48 bits is what most current CPUs support. That is about 256 TB worth of addressing space. With a full implementation of 64 bit one could have 16 EB worth of addressing space.
Logic without the fatal effects.
All code snippets are licensed under WTFPL.
I have read at various places, i.e; in many articles and in different books. That your drive containing windows should be more than 5 GB. Let the window get as much it can take. Because when there will be more place for window to absorb, it will work smoothly.