No, I am not aware of any solution that would let you do this. I'm not sure this is even possible without major architectural changes; after all, the OS usually decides on a case-by-case basis which data to swap out and which to keep in RAM. It's not clear to me such a restriction would even be practical; at any rate it would probably require deep changes to the OS.
Counter-question: Why do you feel this is necessary? The virtual memory subsystem of a modern OS has been finely tuned to give you the best performance possible. What makes you believe you can do better?
Plus:
If you really are having memory problems, just go buy more RAM. 4GB go for around $100, just buying it is probably more effective than spending hours on fine-tuning the VM subsystem...