whilst i'm not sure where the code itself is kept, yes, linux keeps *lots* cached.
use top to look at your ram usage stats, it shows how much of your ram is used as cache (i have a gig of ram, right now i'm using about 300 megs for the stuff i am running and using about 700megs as cache). your hard-drive will also have a few megabytes of cache built in. linux is awesome at using your free ram as cache, its a *very* cool thing, i tend to hammer my drives with various databases and the read cache makes things happen so much quicker. its also very good at releasing cache, so whilst my system is using 700megs of ram as cache, if i need it to run my software, it just releases it to whatever needs it.