I have the following shell script that I've been using in previous versions of Ubuntu (<= 11.04) to clear memory cache and it has worked fine:
sudo sync && sudo sysctl -w vm.drop_caches=3 && sudo sysctl -w vm.drop_caches=0
I have a new clean install of 11.10 with 3.0.0-12-generic kernel and I get the following error when running the same script script:
vm.drop_caches = 3
error: "Invalid argument" setting key "vm.drop_caches"